Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.batik.dom.util
Class HashTable  view HashTable download HashTable.java

java.lang.Object
  extended byorg.apache.batik.dom.util.HashTable
All Implemented Interfaces:
java.io.Serializable

public class HashTable
extends java.lang.Object
implements java.io.Serializable

A simple hashtable, not synchronized, with fixed load factor.

Version:
$Id: HashTable.java,v 1.7 2005/02/22 09:13:02 cam Exp $

Nested Class Summary
protected static class HashTable.Entry
          To manage collisions
 
Field Summary
protected  int count
          The number of entries
protected static int INITIAL_CAPACITY
          The initial capacity
protected  HashTable.Entry[] table
          The underlying array
 
Constructor Summary
HashTable()
          Creates a new table.
HashTable(HashTable t)
          Creates a copy of the given HashTable object.
HashTable(int c)
          Creates a new table.
 
Method Summary
 void clear()
          Clears the map.
 java.lang.Object get(java.lang.Object key)
          Gets the value of a variable
 java.lang.Object item(int index)
          Returns the item at the given position.
 java.lang.Object key(int index)
          Returns the key at the given position or null.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Sets a new value for the given variable
protected  void rehash()
          Rehash the table
 java.lang.Object remove(java.lang.Object key)
          Removes an entry from the table.
 int size()
          Returns the size of this table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INITIAL_CAPACITY

protected static final int INITIAL_CAPACITY
The initial capacity

See Also:
Constant Field Values

table

protected HashTable.Entry[] table
The underlying array


count

protected int count
The number of entries

Constructor Detail

HashTable

public HashTable()
Creates a new table.


HashTable

public HashTable(int c)
Creates a new table.


HashTable

public HashTable(HashTable t)
Creates a copy of the given HashTable object.

Method Detail

size

public int size()
Returns the size of this table.


get

public java.lang.Object get(java.lang.Object key)
Gets the value of a variable


put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Sets a new value for the given variable


remove

public java.lang.Object remove(java.lang.Object key)
Removes an entry from the table.


key

public java.lang.Object key(int index)
Returns the key at the given position or null.


item

public java.lang.Object item(int index)
Returns the item at the given position.


clear

public void clear()
Clears the map.


rehash

protected void rehash()
Rehash the table