|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.ObjectOutputStream.HandleTable
Lightweight identity hash table which maps objects to integer handles, assigned in ascending order.
Field Summary | |
private float |
loadFactor
|
private int[] |
next
|
private Object[] |
objs
|
private int |
size
|
private int[] |
spine
|
private int |
threshold
|
Constructor Summary | |
(package private) |
ObjectOutputStream.HandleTable(int initialCapacity,
float loadFactor)
Creates new HandleTable with given capacity and load factor. |
Method Summary | |
(package private) int |
assign(Object obj)
Assigns next available handle to given object, and returns handle value. |
(package private) void |
clear()
Resets table to its initial (empty) state. |
private void |
growEntries()
Increases hash table capacity by lengthening entry arrays. |
private void |
growSpine()
Expands the hash "spine" -- equivalent to increasing the number of buckets in a conventional hash table. |
private int |
hash(Object obj)
Returns hash value for given object. |
private void |
insert(Object obj,
int handle)
Inserts mapping object -> handle mapping into table. |
(package private) int |
lookup(Object obj)
Looks up and returns handle associated with given object, or -1 if no mapping found. |
(package private) int |
size()
Returns the number of mappings currently in table. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private int size
private int threshold
private final float loadFactor
private int[] spine
private int[] next
private Object[] objs
Constructor Detail |
ObjectOutputStream.HandleTable(int initialCapacity, float loadFactor)
Method Detail |
int assign(Object obj)
int lookup(Object obj)
void clear()
int size()
private void insert(Object obj, int handle)
private void growSpine()
private void growEntries()
private int hash(Object obj)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |