E
- The type of object to use.public class HashPool<E>
extends HashMap<Integer,ArrayList<E>>
Constructor and Description |
---|
HashPool() |
Modifier and Type | Method and Description |
---|---|
E |
add(E obj)
Adds the object to the pool if an identical copy doesn't already exist.
|
boolean |
contains(E obj)
Checks the HashPool if it contains an equal object to obj as defined by the equals() method.
|
E |
find(E obj)
Gets the identical object in the HashPool that is equal by definition of the equals()
method.
|
HashMap<E,ArrayList<Integer>> |
getEnumerationMap() |
ArrayList<E> |
getEnumerations() |
Integer |
getEnumerationValue(E obj)
Gets the Integer enumeration of the object based on the HashPool.
|
void |
setEnumerationMap(HashMap<E,ArrayList<Integer>> enumerationMap) |
void |
setEnumerations(ArrayList<E> enumerations) |
public Integer getEnumerationValue(E obj)
obj
- The object to get an enumeration value for.public E add(E obj)
obj
- The object to be addedpublic boolean contains(E obj)
obj
- The object to check for.public E find(E obj)
obj
- The object to find in the poolpublic ArrayList<E> getEnumerations()
public void setEnumerations(ArrayList<E> enumerations)
enumerations
- the enumerations to setpublic HashMap<E,ArrayList<Integer>> getEnumerationMap()
public void setEnumerationMap(HashMap<E,ArrayList<Integer>> enumerationMap)
enumerationMap
- the enumerationMap to set