|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.hdcookbook.grin.util.IndexedSet<T>
public class IndexedSet<T>
This class represents a set of objects of type T that are assigned indexes. It is used for canonicalizing instances of an arbitrary type T, provided that T obeys the Object.equals()/Object.hashCode() contract.
Constructor Summary | |
---|---|
IndexedSet()
|
Method Summary | |
---|---|
int |
getIndex(T element)
Get the index of element in the set, adding it if necessary. |
int |
size()
|
T[] |
toArray(java.lang.Class type)
Convert the set to an array, indexed by the index of each element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IndexedSet()
Method Detail |
---|
public int getIndex(T element)
public T[] toArray(java.lang.Class type)
public int size()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |