|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.vizzini.util.AbstractCollection
org.vizzini.util.AbstractMap
org.vizzini.game.TokenCollection
public class TokenCollection
Provides a collection to hold IToken s.
| Constructor Summary | |
|---|---|
TokenCollection()
Construct this object. |
|
TokenCollection(int initialCapacity)
Construct this object with the given parameters. |
|
| Method Summary | |
|---|---|
boolean |
add(Object object)
Add the given object. |
Object |
clone()
Return a deep clone of this instance. |
void |
configure(Properties properties)
Configure this collection. |
void |
configure(Properties properties,
int index)
Configure this collection. |
IToken |
findByName(String name)
Return the team with the given name. |
IToken |
get(Class tokenType,
IAgent agent)
Return the first token found of the given type belonging to the given agent. |
IToken |
get(IPosition position)
Return the token at the given position. |
protected Map |
getData()
Return the data collection. |
protected Object |
getKey(Object object)
Return the token key. |
protected Object |
getKey(String name,
String teamName,
String agentName)
Return the token key. |
String[] |
getTokenPropertyNames()
Return the property names of interest to this. |
protected Class |
getType()
Return the type this collection holds. |
Iterator |
iterator(Class aClass)
Return an iterator over the collection of tokens of the given class. |
void |
propertyChange(PropertyChangeEvent event)
Implement a property change listener for relevant token properties. |
boolean |
remove(Object object)
Add the given object. |
| 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 |
|---|
public TokenCollection()
public TokenCollection(int initialCapacity)
| Method Detail |
|---|
public boolean add(Object object)
add in interface Collectionadd in class AbstractMappublic Object clone()
clone in interface ITokenCollectionclone in class Object
public void configure(Properties properties)
throws InstantiationException,
IllegalAccessException
configure in interface ITokenCollectionproperties - Source of configuration information. This is
typically the game.properties.
InstantiationException
IllegalAccessException
public void configure(Properties properties,
int index)
throws InstantiationException,
IllegalAccessException
properties - Source of configuration information. This is
typically the gameUI.properties.index - Agent index.
InstantiationException
IllegalAccessExceptionpublic IToken findByName(String name)
findByName in interface ITokenCollectionpublic IToken get(IPosition position)
get in interface ITokenCollection
public IToken get(Class tokenType,
IAgent agent)
get in interface ITokenCollectionpublic String[] getTokenPropertyNames()
public Iterator iterator(Class aClass)
iterator in interface ITokenCollectionpublic void propertyChange(PropertyChangeEvent event)
propertyChange in interface PropertyChangeListenerpublic boolean remove(Object object)
remove in interface Collectionremove in class AbstractMapprotected Map getData()
getData in class AbstractMapprotected Object getKey(Object object)
getKey in class AbstractMap
protected Object getKey(String name,
String teamName,
String agentName)
protected Class getType()
getType in class AbstractCollection
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
| Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |