org.apache.batik.dom.util

Class TriplyIndexedTable

public class TriplyIndexedTable extends Object

This class represents a triply indexed hash table.
Note: This implementation is not Thread-safe.
Nested Class Summary
protected static classTriplyIndexedTable.Entry
To manage collisions
Field Summary
protected intcount
The number of entries
protected static intINITIAL_CAPACITY
The initial capacity
protected TriplyIndexedTable.Entry[]table
The underlying array
Constructor Summary
TriplyIndexedTable()
Creates a new TriplyIndexedTable.
TriplyIndexedTable(int c)
Creates a new TriplyIndexedTable.
Method Summary
Objectget(Object o1, Object o2, Object o3)
Gets the value of an entry
protected inthashCode(Object o1, Object o2, Object o3)
Computes a hash code corresponding to the given objects.
Objectput(Object o1, Object o2, Object o3, Object value)
Puts a value in the table.
protected voidrehash()
Rehash the table
intsize()
Returns the size of this table.

Field Detail

count

protected int count
The number of entries

INITIAL_CAPACITY

protected static final int INITIAL_CAPACITY
The initial capacity

table

protected TriplyIndexedTable.Entry[] table
The underlying array

Constructor Detail

TriplyIndexedTable

public TriplyIndexedTable()
Creates a new TriplyIndexedTable.

TriplyIndexedTable

public TriplyIndexedTable(int c)
Creates a new TriplyIndexedTable.

Parameters: c The inital capacity.

Method Detail

get

public Object get(Object o1, Object o2, Object o3)
Gets the value of an entry

Returns: the value or null

hashCode

protected int hashCode(Object o1, Object o2, Object o3)
Computes a hash code corresponding to the given objects.

put

public Object put(Object o1, Object o2, Object o3, Object value)
Puts a value in the table.

Returns: the old value or null

rehash

protected void rehash()
Rehash the table

size

public int size()
Returns the size of this table.
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.