|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.vizzini.util.AbstractCollection
org.vizzini.game.TokenArrayCollection
public class TokenArrayCollection
Provides a collection to hold IToken s, where the tokens are
stored by their position in a three dimensional array. This class assumes the
use of IntegerPosition for all IPosition s.
| Constructor Summary | |
|---|---|
TokenArrayCollection()
|
|
| Method Summary | |
|---|---|
boolean |
add(Object object)
Add the given object. |
void |
clear()
Removes all of the objects from this collection. |
Object |
clone()
Return a clone of this instance. |
void |
configure(Properties properties)
Configure this collection. |
boolean |
contains(Object object)
Returns true if this collection contains the given object. |
boolean |
equals(Object object)
Return true if the given object is equal to this. |
IToken |
findByName(String name)
Return the token 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(int file,
int rank,
int level)
Return the token at the given position. |
IToken |
get(IPosition position)
Return the token at the given position. |
protected Class |
getType()
Return the type this collection holds. |
int |
hashCode()
Returns a hash code value for the object. |
boolean |
isEmpty()
Return true if this is empty. |
Iterator |
iterator()
Return an iterator over the object collection. |
Iterator |
iterator(Class aClass)
Return an iterator over the collection of tokens of the given class. |
void |
move(IntegerPosition fromPosition,
IntegerPosition toPosition)
Move a token from the given position to the new position. |
void |
move(int file0,
int rank0,
int level0,
int file1,
int rank1,
int level1)
Move a token from the given position to the new position. |
boolean |
remove(Object object)
Remove the given object. |
int |
size()
Return the size of this collection. |
| Methods inherited from class org.vizzini.util.AbstractCollection |
|---|
addAll, containsAll, removeAll, retainAll, toArray, toArray, toString |
| 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, containsAll, removeAll, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public TokenArrayCollection()
| Method Detail |
|---|
public boolean add(Object object)
add in interface Collectionpublic void clear()
clear in interface Collectionpublic 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
IllegalAccessExceptionpublic boolean contains(Object object)
contains in interface Collectionpublic boolean equals(Object object)
equals in interface Collectionequals in class Objectobject - The object to compare.public 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 ITokenCollection
public IToken get(int file,
int rank,
int level)
public int hashCode()
hashCode in interface CollectionhashCode in class Objectpublic boolean isEmpty()
isEmpty in interface Collectionpublic Iterator iterator()
iterator in interface Iterableiterator in interface Collectionpublic Iterator iterator(Class aClass)
iterator in interface ITokenCollection
public void move(IntegerPosition fromPosition,
IntegerPosition toPosition)
public void move(int file0,
int rank0,
int level0,
int file1,
int rank1,
int level1)
public boolean remove(Object object)
remove in interface Collectionpublic int size()
size in interface Collectionprotected 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 |