Class HashtableOfObject
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.util.HashtableOfObject
- All Implemented Interfaces:
Cloneable
Hashtable of {char[] --> Object }
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
calculateNewSize(int currentSize)
Tries to double the number of given elements but returnsMAX_ARRAY_SIZE
- 2 in case new value would overflowvoid
clear()
clone()
boolean
containsKey(char[] key)
get(char[] key)
void
putUnsafely(char[] key, Object value)
Put a value at the index of the given using the local hash code computation.removeKey(char[] key)
int
size()
int
toString()
-
Field Details
-
MAX_ARRAY_SIZE
public static final int MAX_ARRAY_SIZEMax array size accepted by JVM- See Also:
- Constant Field Values
-
keyTable
public char[][] keyTable -
valueTable
-
elementSize
public int elementSize
-
-
Constructor Details
-
HashtableOfObject
public HashtableOfObject() -
HashtableOfObject
public HashtableOfObject(int size)- Parameters:
size
- preferred table size- Throws:
NegativeArraySizeException
- if size is negativeOutOfMemoryError
- if size exceedsMAX_ARRAY_SIZE
-
-
Method Details
-
clear
public void clear() -
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
containsKey
public boolean containsKey(char[] key) -
get
-
put
-
putUnsafely
Put a value at the index of the given using the local hash code computation.Note that this is an unsafe put as there's no prior verification whether the given key already exists in the table or not.
- Parameters:
key
- The key of the table entryvalue
- The value of the table entry
-
removeKey
-
calculateNewSize
public static int calculateNewSize(int currentSize)Tries to double the number of given elements but returnsMAX_ARRAY_SIZE
- 2 in case new value would overflow- Returns:
- new map size that fits to JVM limits or throws an error
-
storageSize
public int storageSize() -
size
public int size() -
toString
-