Blackjack

com.amoebacode.blackjack.event
Class EventListenerCollection

java.lang.Object
  |
  +--com.amoebacode.blackjack.event.EventListenerCollection
Direct Known Subclasses:
BasicStrategyEventListenerCollection, DealerEventListenerCollection, DeckEventListenerCollection, GameEventListenerCollection, HandEventListenerCollection, PlayerEventListenerCollection, RoundEventListenerCollection

public abstract class EventListenerCollection
extends java.lang.Object

EventListenerCollection manages a collection of blackjack event listeners.

Version:
0.9
Author:
Jason Gurney

Field Summary
private  java.util.List listeners
          The list of blackjack event listeners
 
Constructor Summary
protected EventListenerCollection()
          Default protected constructor.
 
Method Summary
 void addEventListener(BlackjackEventListener listener)
          Adds the specified blackjack event listener to this collection.
protected  BlackjackEventListener getEventListenerAt(int index)
          Returns the blackjack event listener at the specified index.
protected  int getNumberOfListeners()
          Returns the number of blackjack event listeners in this collection.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

listeners

private java.util.List listeners
The list of blackjack event listeners
Constructor Detail

EventListenerCollection

protected EventListenerCollection()
Default protected constructor.
Method Detail

addEventListener

public void addEventListener(BlackjackEventListener listener)
Adds the specified blackjack event listener to this collection.
Parameters:
listener - the BlackjackEventListener to add

getNumberOfListeners

protected int getNumberOfListeners()
Returns the number of blackjack event listeners in this collection.
Returns:
the number of listeners

getEventListenerAt

protected BlackjackEventListener getEventListenerAt(int index)
Returns the blackjack event listener at the specified index.
Parameters:
index - the index of the listener to retrieve
Returns:
the BlackjackEventListener at the specified index

Blackjack

Copyright © 2002 amoebacode.com.