AddressSpace library v1.0 beta

Class IntHashtable

java.lang.Object
  |
  +--IntHashtable

public class IntHashtable
extends java.lang.Object

Hastable used to store objects.
Elements are stored inside the hastable using an integer rather than another object as key to speedup performances.
The beaviour reseems the java.util.Hastable, not everithing was rewrited but this class is also synchronized.


This class was writted starting from the source of java.util.Hashtable of SUN distributed with JDK 1.2

Version:
1.0 June 05 2000
Author:
Dario Maggiorini (dario@dsi.unimi.it)

Constructor Summary
IntHashtable()
          Create an empty hash with default load factors.
 
Method Summary
 java.lang.Object get(int key)
          Get an object from the batle.
 java.lang.Object put(int key, java.lang.Object value)
          Add an object in the table.
protected  void rehash()
          Internal, used to rebalance the has table.
 java.lang.Object remove(int key)
          Remove an object from the table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntHashtable

public IntHashtable()
Create an empty hash with default load factors.
Method Detail

get

public java.lang.Object get(int key)
Get an object from the batle.
The object associated to the key is returned.
Returns:
the object found or null if no object was found

put

public java.lang.Object put(int key,
                            java.lang.Object value)
                     throws java.lang.NullPointerException
Add an object in the table.
The null object is not supported.
Parameters:
key - the key associated to the object
value - the object to insert
Returns:
the old object if the key where already present in the table or null otherwise.

remove

public java.lang.Object remove(int key)
Remove an object from the table.
Parameters:
key - the key associated to the object
Returns:
the old object if the key where present in the table or null otherwise.

rehash

protected void rehash()
Internal, used to rebalance the has table.
used to extend the table when it's full.

Help is irrilevant
You will be assimilated!

v1.0 beta by Dario Maggiorini