|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.joanju.proparse.IntegerIndex<T>
public class IntegerIndex<T>
Generic class for working with integer indexed data of type T. ie: You want to be able to lookup the value at integer index n, and you also want to be able to find the integer index of some data of type T. Integer indexes start from zero, as in Java array indexes.
Constructor Summary | |
---|---|
IntegerIndex()
|
Method Summary | |
---|---|
int |
add(T val)
Add the value if it's not already there. |
void |
clear()
|
int |
getIndex(T val)
Returns -1 if not found. |
T |
getValue(int index)
Returns null if not found. |
java.util.ArrayList<T> |
getValues()
Returns an array list in order from zero to number of indexes of all the values. |
boolean |
hasIndex(int index)
|
boolean |
hasValue(T value)
|
int |
size()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IntegerIndex()
Method Detail |
---|
public int add(T val)
public void clear()
public int getIndex(T val)
public T getValue(int index)
public java.util.ArrayList<T> getValues()
public boolean hasIndex(int index)
public boolean hasValue(T value)
public int size()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |