Package org.apache.batik.util
Class DoublyIndexedTable
java.lang.Object
org.apache.batik.util.DoublyIndexedTable
This class represents a doubly indexed hash table.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
An entry in theDoublyIndexedTable
.protected class
An Iterator class for aDoublyIndexedTable
. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
The number of entriesprotected int
The initial capacityprotected DoublyIndexedTable.Entry[]
The underlying array -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new DoublyIndexedTable.DoublyIndexedTable
(int c) Creates a new DoublyIndexedTable.Creates a new DoublyIndexedTable initialized to contain all of the entries of the specified other DoublyIndexedTable. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears the table.Gets the value of an entryObject[]
Returns an array of all of the values in the table.protected int
Computes a hash code corresponding to the given objects.iterator()
Returns an iterator on the entries of the table.Puts a value in the table.protected void
rehash()
Rehash the tableRemoves an entry from the table.int
size()
Returns the size of this table.
-
Field Details
-
initialCapacity
protected int initialCapacityThe initial capacity -
table
The underlying array -
count
protected int countThe number of entries
-
-
Constructor Details
-
DoublyIndexedTable
public DoublyIndexedTable()Creates a new DoublyIndexedTable. -
DoublyIndexedTable
public DoublyIndexedTable(int c) Creates a new DoublyIndexedTable.- Parameters:
c
- The inital capacity.
-
DoublyIndexedTable
Creates a new DoublyIndexedTable initialized to contain all of the entries of the specified other DoublyIndexedTable.
-
-
Method Details
-
size
public int size()Returns the size of this table. -
put
Puts a value in the table.- Returns:
- the old value or null
-
get
Gets the value of an entry- Returns:
- the value or null
-
remove
Removes an entry from the table.- Returns:
- the value or null
-
getValuesArray
Returns an array of all of the values in the table. -
clear
public void clear()Clears the table. -
iterator
Returns an iterator on the entries of the table. -
rehash
protected void rehash()Rehash the table -
hashCode
Computes a hash code corresponding to the given objects.
-