Package org.mozilla.javascript
Class UintMap
- java.lang.Object
- 
- org.mozilla.javascript.UintMap
 
- 
- All Implemented Interfaces:
- java.io.Serializable
 
 public class UintMap extends java.lang.Object implements java.io.SerializableMap to associate non-negative integers to objects or 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.- See Also:
- Serialized Form
 
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()intgetExistingInt(int key)Get integer value assigned with key.intgetInt(int key, int defaultValue)Get integer value assigned with key.int[]getKeys()Return array of present keysjava.lang.ObjectgetObject(int key)Get object value assigned with key.booleanhas(int key)booleanisEmpty()voidput(int key, int value)Set int value of the key.voidput(int key, java.lang.Object value)Set object value of the key.voidremove(int key)intsize()
 
- 
- 
- 
Method Detail- 
isEmptypublic boolean isEmpty() 
 - 
sizepublic int size() 
 - 
haspublic boolean has(int key) 
 - 
getObjectpublic java.lang.Object getObject(int key) Get object value assigned with key.- Returns:
- key object value or null if key is absent
 
 - 
getIntpublic int getInt(int key, int defaultValue)Get integer value assigned with key.- Returns:
- key integer value or defaultValue if key is absent
 
 - 
getExistingIntpublic int getExistingInt(int key) Get integer value assigned with key.- Returns:
- key integer value or defaultValue if key does not exist or does not have int value
- Throws:
- java.lang.RuntimeException- if key does not exist
 
 - 
putpublic void put(int key, java.lang.Object value)Set object value of the key. If key does not exist, also set its int value to 0.
 - 
putpublic void put(int key, int value)Set int value of the key. If key does not exist, also set its object value to null.
 - 
removepublic void remove(int key) 
 - 
clearpublic void clear() 
 - 
getKeyspublic int[] getKeys() Return array of present keys
 
- 
 
-