|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jibx.binding.util.ArrayMap
public class ArrayMap
Array with reverse mapping from values to indices. This operates as the combination of an array with ordinary int indices and a hashmap from values back to the corresponding index position. Values are assured to be unique.
| Constructor Summary | |
|---|---|
ArrayMap()
Default constructor. |
|
ArrayMap(int size)
Constructor with initial capacity supplied. |
|
| Method Summary | |
|---|---|
int |
find(Object obj)
Find existing object. |
int |
findOrAdd(Object obj)
Add object. |
Object |
get(int index)
Get value for index. |
int |
size()
Get count of values present. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ArrayMap()
public ArrayMap(int size)
size - initial capacity for array map| Method Detail |
|---|
public Object get(int index)
index - number to be looked up
public int find(Object obj)
obj - value to be found
-1 if not foundpublic int findOrAdd(Object obj)
obj - value to be added
public int size()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||