| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final int | |
| pack-priv static final int | DEFAULT_SIZE
Default size of a compact hash-based collection. |
| pack-priv static final int | HASH_TABLE_BITS_MASK
Bitmask that selects the low bits of metadata to get hashTableBits. |
| private static final int | HASH_TABLE_BITS_MAX_BITS
Number of bits used to store the numbers of hash table bits (max 30). |
| pack-priv static final int | MAX_SIZE
Maximum size of a compact hash-based collection (2^30 - 1 because 0 is UNSET). |
| private static final int | MIN_HASH_TABLE_SIZE
Minimum size of the hash table of a compact hash-based collection. |
| pack-priv static final int | MODIFICATION_COUNT_INCREMENT
Use high bits of metadata for modification count. |
| private static final int | |
| private static final int | |
| pack-priv static final byte | UNSET
Indicates blank table entries. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static Object | createTable(int buckets)
Creates and returns a properly-sized array with the given number of buckets. |
| pack-priv static int | |
| pack-priv static int | |
| pack-priv static int | maskCombine(int prefix, int suffix, int mask)
Returns a new value combining the prefix and suffix using the given mask. |
| pack-priv static int | |
| pack-priv static int | |
| pack-priv static void | |
| pack-priv static int | |
| pack-priv static void | |
| pack-priv static int | tableSize(int expectedSize)
Returns the power of 2 hashtable size required to hold the expected number of items or the minimum hashtable size, whichever is greater. |
| BYTE_MASK | back to summary |
|---|---|
| private static final int BYTE_MASK | |
| BYTE_MAX_SIZE | back to summary |
|---|---|
| private static final int BYTE_MAX_SIZE | |
| DEFAULT_SIZE | back to summary |
|---|---|
| pack-priv static final int DEFAULT_SIZE Default size of a compact hash-based collection. | |
| HASH_TABLE_BITS_MASK | back to summary |
|---|---|
| pack-priv static final int HASH_TABLE_BITS_MASK Bitmask that selects the low bits of metadata to get hashTableBits. | |
| HASH_TABLE_BITS_MAX_BITS | back to summary |
|---|---|
| private static final int HASH_TABLE_BITS_MAX_BITS Number of bits used to store the numbers of hash table bits (max 30). | |
| MAX_SIZE | back to summary |
|---|---|
| pack-priv static final int MAX_SIZE Maximum size of a compact hash-based collection (2^30 - 1 because 0 is UNSET). | |
| MIN_HASH_TABLE_SIZE | back to summary |
|---|---|
| private static final int MIN_HASH_TABLE_SIZE Minimum size of the hash table of a compact hash-based collection. Because small hash tables use a byte[], any smaller size uses the same amount of memory due to object padding. | |
| MODIFICATION_COUNT_INCREMENT | back to summary |
|---|---|
| pack-priv static final int MODIFICATION_COUNT_INCREMENT Use high bits of metadata for modification count. | |
| SHORT_MASK | back to summary |
|---|---|
| private static final int SHORT_MASK | |
| SHORT_MAX_SIZE | back to summary |
|---|---|
| private static final int SHORT_MAX_SIZE | |
| UNSET | back to summary |
|---|---|
| pack-priv static final byte UNSET Indicates blank table entries. | |
| CompactHashing | back to summary |
|---|---|
| private CompactHashing() | |
| createTable | back to summary |
|---|---|
| pack-priv static Object createTable(int buckets) Creates and returns a properly-sized array with the given number of buckets. | |
| getHashPrefix | back to summary |
|---|---|
| pack-priv static int getHashPrefix(int value, int mask) Returns the hash prefix given the current mask. | |
| getNext | back to summary |
|---|---|
| pack-priv static int getNext(int entry, int mask) Returns the index, or 0 if the entry is "null". | |
| maskCombine | back to summary |
|---|---|
| pack-priv static int maskCombine(int prefix, int suffix, int mask) Returns a new value combining the prefix and suffix using the given mask. | |
| newCapacity | back to summary |
|---|---|
| pack-priv static int newCapacity(int mask) Returns a larger power of 2 hashtable size given the current mask. For hashtable sizes less than or equal to 32, the returned power of 2 is 4x the current hashtable size to reduce expensive rehashing. Otherwise the returned power of 2 is 2x the current hashtable size. | |
| remove | back to summary |
|---|---|
| pack-priv static int remove(Object key, Object value, int mask, Object table, int[] entries, @Nullable Object[] keys, @Nullable Object[] values) | |
| tableClear | back to summary |
|---|---|
| pack-priv static void tableClear(Object table) | |
| tableGet | back to summary |
|---|---|
| pack-priv static int tableGet(Object table, int index) Returns | |
| tableSet | back to summary |
|---|---|
| pack-priv static void tableSet(Object table, int index, int entry) Sets | |
| tableSize | back to summary |
|---|---|
| pack-priv static int tableSize(int expectedSize) Returns the power of 2 hashtable size required to hold the expected number of items or the minimum hashtable size, whichever is greater. | |