org.vizzini.game
Class TokenPositionCollection

java.lang.Object
  extended by org.vizzini.util.AbstractCollection
      extended by org.vizzini.util.AbstractMap
          extended by org.vizzini.game.TokenCollection
              extended by org.vizzini.game.TokenPositionCollection
All Implemented Interfaces:
PropertyChangeListener, Serializable, Cloneable, Iterable, Collection, EventListener, ITokenCollection, ICollection

public class TokenPositionCollection
extends TokenCollection

Provides a collection to hold IToken s, where the tokens are stored by their position.

Since:
v0.1
Version:
v0.3
Author:
Jeffrey M. Thompson
See Also:
Serialized Form

Constructor Summary
TokenPositionCollection()
          Construct this object.
TokenPositionCollection(int initialCapacity)
          Construct this object with the given parameters.
 
Method Summary
 IToken findByName(String name)
          Return the token with the given name.
 IToken get(IPosition position)
          Return the token at the given position.
protected  Object getKey(Object object)
          Return the token key.
 String[] getTokenPropertyNames()
          Return the property names of interest to this.
 void propertyChange(PropertyChangeEvent event)
          Implement a property change listener for relevant token properties.
 
Methods inherited from class org.vizzini.game.TokenCollection
add, clone, configure, configure, get, getData, getKey, getType, iterator, remove
 
Methods inherited from class org.vizzini.util.AbstractMap
clear, contains, equals, hashCode, isEmpty, iterator, size, toString
 
Methods inherited from class org.vizzini.util.AbstractCollection
addAll, containsAll, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.vizzini.util.ICollection
toString
 
Methods inherited from interface java.util.Collection
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

TokenPositionCollection

public TokenPositionCollection()
Construct this object.

Since:
v0.1

TokenPositionCollection

public TokenPositionCollection(int initialCapacity)
Construct this object with the given parameters.

Since:
v0.1
Method Detail

findByName

public IToken findByName(String name)
Return the token with the given name.

Specified by:
findByName in interface ITokenCollection
Overrides:
findByName in class TokenCollection
Since:
v0.1

get

public IToken get(IPosition position)
Return the token at the given position.

Specified by:
get in interface ITokenCollection
Overrides:
get in class TokenCollection
Since:
v0.1

getTokenPropertyNames

public String[] getTokenPropertyNames()
Return the property names of interest to this.

Overrides:
getTokenPropertyNames in class TokenCollection
Since:
v0.2

propertyChange

public void propertyChange(PropertyChangeEvent event)
Implement a property change listener for relevant token properties. This method re-maps a token if the token's position has changed.

Specified by:
propertyChange in interface PropertyChangeListener
Overrides:
propertyChange in class TokenCollection
Since:
v0.2

getKey

protected Object getKey(Object object)
Return the token key.

Overrides:
getKey in class TokenCollection
Since:
v0.1


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02