FastCopyHashMap by Jason T. Greene.
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | DEFAULT_CAPACITY
Same default as HashMap, must be a power of 2 |
| private static final float | DEFAULT_LOAD_FACTOR
67%, just like IdentityHashMap |
| private final float | loadFactor
The user defined load factor which defines when to resize |
| private static final int | MAXIMUM_CAPACITY
MAX_INT - 1 |
| private static final long | |
| private transient int | size
The current number of key-value pairs |
| private transient IntKeyMap. | table
The open-addressed table |
| private transient int | threshold
The next resize |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public IntKeyMap | |
| public boolean | |
| public boolean | |
| private static boolean | |
| public V | |
| private static int | |
| private void | |
| public boolean | |
| public Iterator | Returns: the entry iteratorImplements java. |
| private int | |
| public void | |
| public V | |
| private void | |
| private void | |
| private void | |
| public V | |
| private void | |
| public int | |
| private void |
| DEFAULT_CAPACITY | back to summary |
|---|---|
| private static final int DEFAULT_CAPACITY Same default as HashMap, must be a power of 2 | |
| DEFAULT_LOAD_FACTOR | back to summary |
|---|---|
| private static final float DEFAULT_LOAD_FACTOR 67%, just like IdentityHashMap | |
| loadFactor | back to summary |
|---|---|
| private final float loadFactor The user defined load factor which defines when to resize | |
| MAXIMUM_CAPACITY | back to summary |
|---|---|
| private static final int MAXIMUM_CAPACITY MAX_INT - 1 | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| size | back to summary |
|---|---|
| private transient int size The current number of key-value pairs | |
| table | back to summary |
|---|---|
| private transient IntKeyMap. The open-addressed table | |
| threshold | back to summary |
|---|---|
| private transient int threshold The next resize | |
| IntKeyMap | back to summary |
|---|---|
| public IntKeyMap(int initialCapacity, float loadFactor) | |
| IntKeyMap | back to summary |
|---|---|
public IntKeyMap(IntKeyMap<? extends V> map)
| |
| IntKeyMap | back to summary |
|---|---|
| public IntKeyMap(int initialCapacity) | |
| IntKeyMap | back to summary |
|---|---|
| public IntKeyMap() | |
| clear | back to summary |
|---|---|
| public void clear() | |
| clone | back to summary |
|---|---|
| public IntKeyMap Overrides java. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by
| |
| containsKey | back to summary |
|---|---|
| public boolean containsKey(int key) | |
| containsValue | back to summary |
|---|---|
| public boolean containsValue(Object value) | |
| eq | back to summary |
|---|---|
| private static boolean eq(Object o1, Object o2) | |
| get | back to summary |
|---|---|
| public V get(int key) | |
| index | back to summary |
|---|---|
| private static int index(int hashCode, int length) | |
| init | back to summary |
|---|---|
private void init(int initialCapacity, float loadFactor)
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() | |
| iterator | back to summary |
|---|---|
| public Iterator Implements java. Iterate over the entries. Read-only operation. | |
| nextIndex | back to summary |
|---|---|
| private int nextIndex(int index, int length) | |
| printDebugStats | back to summary |
|---|---|
| public void printDebugStats() | |
| put | back to summary |
|---|---|
| public V put(int key, V value) | |
| putForCreate | back to summary |
|---|---|
private void putForCreate(int key, V value)
| |
| readObject | back to summary |
|---|---|
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException
| |
| relocate | back to summary |
|---|---|
| private void relocate(int start) | |
| remove | back to summary |
|---|---|
| public V remove(int key) | |
| resize | back to summary |
|---|---|
private void resize(int from)
| |
| size | back to summary |
|---|---|
| public int size() | |
| writeObject | back to summary |
|---|---|
| private void writeObject(ObjectOutputStream s) throws IOException | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public V |
| Entry | back to summary |
|---|---|
| private Entry(int key, V value) | |