org.mozilla.javascript
Class ObjToIntMap
java.lang.Object
org.mozilla.javascript.ObjToIntMap
- Serializable
public class ObjToIntMap
extends java.lang.Object
implements Serializable
Map to associate objects to integers.
The map does not synchronize any of its operation, so either use
it from a single thread or do own synchronization or perform all mutation
operations on one thread before passing the map to others
void | clear()
|
int | get(Object key, int defaultValue) - Get integer value assigned with key.
|
int | getExisting(Object key) - Get integer value assigned with key.
|
Object[] | getKeys() - Return array of present keys
|
void | getKeys(Object[] array, int offset)
|
boolean | has(Object key)
|
Object | intern(Object keyArg) - If table already contains a key that equals to keyArg, return that key
while setting its value to zero, otherwise add keyArg with 0 value to
the table and return it.
|
boolean | isEmpty()
|
ObjToIntMap.Iterator | newIterator()
|
void | put(Object key, int value)
|
void | remove(Object key)
|
int | size()
|
ObjToIntMap
public ObjToIntMap()
ObjToIntMap
public ObjToIntMap(int keyCountHint)
get
public int get(Object key,
int defaultValue)
Get integer value assigned with key.
- key integer value or defaultValue if key is absent
getExisting
public int getExisting(Object key)
Get integer value assigned with key.
getKeys
public Object[] getKeys()
Return array of present keys
getKeys
public void getKeys(Object[] array,
int offset)
has
public boolean has(Object key)
intern
public Object intern(Object keyArg)
If table already contains a key that equals to keyArg, return that key
while setting its value to zero, otherwise add keyArg with 0 value to
the table and return it.
isEmpty
public boolean isEmpty()
put
public void put(Object key,
int value)
remove
public void remove(Object key)