org.cb.cardboard
Class CardBoardEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byorg.cb.cardboard.CardBoardEvent
All Implemented Interfaces:
java.io.Serializable

public class CardBoardEvent
extends java.util.EventObject

An event for a CardBoard.

Version:
$Id: CardBoardEvent.java 129 2004-04-15 05:00:43Z jerome $
Author:
jerome@coffeebreaks.org - last modified by $LastModifiedBy$
See Also:
Serialized Form

Nested Class Summary
static interface CardBoardEvent.BoardIndexes
          A supertype tag for the different indexes implementation.
static class CardBoardEvent.IndexInterval
          A class that allows to specify BoardIndexes as an interval between two indexes.
static class CardBoardEvent.IndexList
          A class that allows to specify BoardIndexes as a list of indexes.
 
Field Summary
static int CONTENTS_CHANGED
          Identifies one or more changes in the lists contents.
static int INTERVAL_ADDED
          Identifies the addition of one or more contiguous items to the list.
static int INTERVAL_REMOVED
          Identifies the removal of one or more contiguous items from the list.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
CardBoardEvent(java.lang.Object source, int type, int index0, int index1)
          Constructs a CardBoardEvent object.
CardBoardEvent(java.lang.Object source, java.util.List indexes)
          Constructs a CardBoardEvent object.
 
Method Summary
 CardBoardEvent.BoardIndexes getBoardIndexes()
          Return the indexes of the cards modified on the board.
 int getType()
          Returns the event _type.
 java.lang.String toString()
          Returns a string representation of this CardBoardEvent.
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONTENTS_CHANGED

public static final int CONTENTS_CHANGED
Identifies one or more changes in the lists contents.

See Also:
Constant Field Values

INTERVAL_ADDED

public static final int INTERVAL_ADDED
Identifies the addition of one or more contiguous items to the list.

See Also:
Constant Field Values

INTERVAL_REMOVED

public static final int INTERVAL_REMOVED
Identifies the removal of one or more contiguous items from the list.

See Also:
Constant Field Values
Constructor Detail

CardBoardEvent

public CardBoardEvent(java.lang.Object source,
                      int type,
                      int index0,
                      int index1)
Constructs a CardBoardEvent object.

Parameters:
source - the source Object (typically this)
type - an int specifying INTERVAL_ADDED, or INTERVAL_REMOVED
index0 - an int specifying the bottom of a range
index1 - an int specifying the top of a range
Throws:
java.lang.IllegalArgumentException - if CONTENTS_CHANGED is specified as _type.

CardBoardEvent

public CardBoardEvent(java.lang.Object source,
                      java.util.List indexes)
Constructs a CardBoardEvent object.

Parameters:
source - the source Object (typically this)
indexes - a List of Integer int specifying the indexes changed.
Method Detail

getType

public int getType()
Returns the event _type. The possible values are:

Returns:
an int representing the _type value

getBoardIndexes

public CardBoardEvent.BoardIndexes getBoardIndexes()
Return the indexes of the cards modified on the board. Can be an instance of range or a list of indexes.

Returns:
the board indexes

toString

public java.lang.String toString()
Returns a string representation of this CardBoardEvent. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.

Returns:
a string representation of this CardBoardEvent.
Since:
1.4


Copyright © 2004 CoffeeBreaks. All Rights Reserved.