org.cb.cardboard
Interface CardBoardModel

All Known Implementing Classes:
AbstractCardBoardModel

public interface CardBoardModel

This interface defines the methods components like JCardBoard use to get the value of each card in a board and the length of the list. Logically the model is a vector, indices vary from 0 to CardBoardModel.getSize() - 1. Any change to the contents or length of the data model must be reported to all of the CardBoardModelListener.

Version:
$Id: CardBoardModel.java 123 2004-04-14 23:45:53Z jerome $
Author:
jerome@coffeebreaks.org - last modified by $LastChangedBy: jerome $

Method Summary
 void addBoardDataListener(CardBoardModelListener listener)
          Adds a listener to the list that's notified each time a change to the data model occurs.
 Card getElementAt(int index)
          Returns the value at the specified index.
 java.util.List getElements()
           
 int getSize()
          Returns the number of cards on the board.
 void removeBoardDataListener(CardBoardModelListener listener)
          Removes a listener from the list that's notified each time a change to the data model occurs.
 

Method Detail

getSize

public int getSize()
Returns the number of cards on the board.

Returns:
the length of the list

getElementAt

public Card getElementAt(int index)
Returns the value at the specified index.

Parameters:
index - the requested index
Returns:
the value at index

getElements

public java.util.List getElements()
Returns:
all the values.

addBoardDataListener

public void addBoardDataListener(CardBoardModelListener listener)
Adds a listener to the list that's notified each time a change to the data model occurs.

Parameters:
listener - the CardBoardModelListener to be added

removeBoardDataListener

public void removeBoardDataListener(CardBoardModelListener listener)
Removes a listener from the list that's notified each time a change to the data model occurs.

Parameters:
listener - the CardBoardModelListener to be removed


Copyright © 2004 CoffeeBreaks. All Rights Reserved.