Package org.apache.batik.dom.util
Class IntTable
- java.lang.Object
-
- org.apache.batik.dom.util.IntTable
-
- All Implemented Interfaces:
java.io.Serializable
public class IntTable extends java.lang.Object implements java.io.SerializableA 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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classIntTable.EntryTo manage collisions.
-
Field Summary
Fields Modifier and Type Field Description protected intcountThe number of entriesprotected static intINITIAL_CAPACITYThe initial capacityprotected IntTable.Entry[]tableThe underlying array
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears the table.intdec(java.lang.Object key)Decrements the value associated with the given key.protected IntTable.Entryfind(java.lang.Object key)Finds the Entry with the given key.intget(java.lang.Object key)Returns the value associated with the given key.intinc(java.lang.Object key)Increments the value associated with the given key.intput(java.lang.Object key, int value)Sets the value associated with the given key.protected voidrehash()Rehashes the table.intremove(java.lang.Object key)Removes an entry from the table.intsize()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 IntTable.Entry[] table
The underlying array
-
count
protected int count
The number of entries
-
-
Constructor Detail
-
IntTable
public IntTable()
Creates a new table.
-
IntTable
public IntTable(int c)
Creates a new table.- Parameters:
c- The initial capacity.
-
IntTable
public IntTable(IntTable t)
Creates a copy of the given HashTable object.- Parameters:
t- The table to copy.
-
-
Method Detail
-
size
public int size()
Returns the size of this table.
-
find
protected IntTable.Entry find(java.lang.Object key)
Finds the Entry with the given key.
-
get
public int get(java.lang.Object key)
Returns the value associated with the given key.
-
put
public int put(java.lang.Object key, int value)Sets the value associated with the given key.
-
inc
public int inc(java.lang.Object key)
Increments the value associated with the given key.
-
dec
public int dec(java.lang.Object key)
Decrements the value associated with the given key.
-
remove
public int remove(java.lang.Object key)
Removes an entry from the table.
-
clear
public void clear()
Clears the table.
-
rehash
protected void rehash()
Rehashes the table.
-
-