Package org.apache.batik.dom.util
Class IntTable
java.lang.Object
org.apache.batik.dom.util.IntTable
- All Implemented Interfaces:
Serializable
A simple hashtable, not synchronized, with fixed load factor,
that maps objects to ints.
This implementation is not Thread-safe.
- Version:
- $Id: IntTable.java 1733416 2016-03-03 07:07:13Z gadams $
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
The number of entriesprotected static final int
The initial capacityprotected IntTable.Entry[]
The underlying array -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears the table.int
Decrements the value associated with the given key.protected IntTable.Entry
Finds the Entry with the given key.int
Returns the value associated with the given key.int
Increments the value associated with the given key.int
Sets the value associated with the given key.protected void
rehash()
Rehashes the table.int
Removes an entry from the table.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
-
-
Constructor Details
-
IntTable
public IntTable()Creates a new table. -
IntTable
public IntTable(int c) Creates a new table.- Parameters:
c
- The initial capacity.
-
IntTable
Creates a copy of the given HashTable object.- Parameters:
t
- The table to copy.
-
-
Method Details
-
size
public int size()Returns the size of this table. -
find
Finds the Entry with the given key. -
get
Returns the value associated with the given key. -
put
Sets the value associated with the given key. -
inc
Increments the value associated with the given key. -
dec
Decrements the value associated with the given key. -
remove
Removes an entry from the table. -
clear
public void clear()Clears the table. -
rehash
protected void rehash()Rehashes the table.
-