Package org.apache.batik.util
Class SoftDoublyIndexedTable
java.lang.Object
org.apache.batik.util.SoftDoublyIndexedTable
This class represents a doubly indexed hash table, which holds
soft references to the contained values.
This HashMap is not Thread-safe.
This HashMap is not Thread-safe.
- Version:
- $Id: SoftDoublyIndexedTable.java 1733416 2016-03-03 07:07:13Z gadams $
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
To manage collisions -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
The number of entriesprotected static final int
The initial capacityprotected ReferenceQueue
The reference queue.protected SoftDoublyIndexedTable.Entry[]
The underlying array -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new SoftDoublyIndexedTable.SoftDoublyIndexedTable
(int c) Creates a new DoublyIndexedTable. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears the table.Gets the value of a variableprotected int
Computes a hash code corresponding to the given objects.Sets a new value for the given variableprotected void
rehash()
Rehash the tableprotected void
Removes the cleared entries.int
size()
Returns the size of this table.
-
Field Details
-
INITIAL_CAPACITY
protected static final int INITIAL_CAPACITYThe initial capacity- See Also:
-
table
The underlying array -
count
protected int countThe number of entries -
referenceQueue
The reference queue.
-
-
Constructor Details
-
SoftDoublyIndexedTable
public SoftDoublyIndexedTable()Creates a new SoftDoublyIndexedTable. -
SoftDoublyIndexedTable
public SoftDoublyIndexedTable(int c) Creates a new DoublyIndexedTable.- Parameters:
c
- The inital capacity.
-
-
Method Details
-
size
public int size()Returns the size of this table. -
get
Gets the value of a variable- Returns:
- the value or null
-
put
Sets a new value for the given variable- Returns:
- the old value or null
-
clear
public void clear()Clears the table. -
rehash
protected void rehash()Rehash the table -
hashCode
Computes a hash code corresponding to the given objects. -
removeClearedEntries
protected void removeClearedEntries()Removes the cleared entries.
-