Package org.apache.batik.util
Class SoftDoublyIndexedTable
- java.lang.Object
-
- org.apache.batik.util.SoftDoublyIndexedTable
-
public class SoftDoublyIndexedTable extends java.lang.Object
This class represents a doubly indexed hash table, which holds soft references to the contained values.
This HashMap is not Thread-safe.- Version:
- $Id: SoftDoublyIndexedTable.java 1733416 2016-03-03 07:07:13Z gadams $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
SoftDoublyIndexedTable.Entry
To manage collisions
-
Field Summary
Fields Modifier and Type Field Description protected int
count
The number of entriesprotected static int
INITIAL_CAPACITY
The initial capacityprotected java.lang.ref.ReferenceQueue
referenceQueue
The reference queue.protected SoftDoublyIndexedTable.Entry[]
table
The underlying array
-
Constructor Summary
Constructors Constructor Description SoftDoublyIndexedTable()
Creates a new SoftDoublyIndexedTable.SoftDoublyIndexedTable(int c)
Creates a new DoublyIndexedTable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears the table.java.lang.Object
get(java.lang.Object o1, java.lang.Object o2)
Gets the value of a variableprotected int
hashCode(java.lang.Object o1, java.lang.Object o2)
Computes a hash code corresponding to the given objects.java.lang.Object
put(java.lang.Object o1, java.lang.Object o2, java.lang.Object value)
Sets a new value for the given variableprotected void
rehash()
Rehash the tableprotected void
removeClearedEntries()
Removes the cleared entries.int
size()
Returns the size of this table.
-
-
-
Field Detail
-
INITIAL_CAPACITY
protected static final int INITIAL_CAPACITY
The initial capacity- See Also:
- Constant Field Values
-
table
protected SoftDoublyIndexedTable.Entry[] table
The underlying array
-
count
protected int count
The number of entries
-
referenceQueue
protected java.lang.ref.ReferenceQueue referenceQueue
The reference queue.
-
-
Method Detail
-
size
public int size()
Returns the size of this table.
-
get
public java.lang.Object get(java.lang.Object o1, java.lang.Object o2)
Gets the value of a variable- Returns:
- the value or null
-
put
public java.lang.Object put(java.lang.Object o1, java.lang.Object o2, java.lang.Object value)
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
protected int hashCode(java.lang.Object o1, java.lang.Object o2)
Computes a hash code corresponding to the given objects.
-
removeClearedEntries
protected void removeClearedEntries()
Removes the cleared entries.
-
-