head 1.1; branch 1.1.1; access ; symbols DEVEL:1.1.1.1 HEAD:1.1.1; locks ; strict; comment @# @; 1.1 date 2001.03.16.18.13.09; author jallali; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2001.03.16.18.13.09; author jallali; state Exp; branches ; next ; desc @@ 1.1 log @Initial revision @ text @

Overview | Package | Class | Tree | Deprecated | Index | Help
| EJCL Xtreme for PalmOS
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## java.util
Class Hashtable

    java.lang.Object
      |
      +--java.util.Hashtable

Direct Known Subclasses:
  Properties

public class Hashtable
extends Object
implements Cloneable, Serializable

Hashtable associates keys with values. Keys and values cannot be null. The size of the Hashtable is the number of key/value pairs it contains. The capacity is the number of key/value pairs the Hashtable can hold. The load factor is a float value which determines how full the Hashtable gets before expanding the capacity. If the load factor of the Hashtable is exceeded, the capacity is doubled.

See Also:
  `Enumeration`, `Serializable`, `Object.equals(java.lang.Object)`, `Object.hashCode()`, Serialized Form

Constructor Summary
`Hashtable()` Constructs a new Hashtable using the default capacity and load factor.
`Hashtable(int capacity)` Constructs a new Hashtable using the specified capacity and the default load factor.

Method Summary
`void` | `clear()` Removes all key/value pairs from this Hashtable, leaving the size zero and the capacity unchanged.
`Object` | `clone()` Answers a new Hashtable with the same key/value pairs, capacity and load factor.
`boolean` | `contains(Object value)` Answers if this Hashtable contains the specified object as the value of at least one of the key/value pairs.
`boolean` | `containsKey(Object key)` Answers if this Hashtable contains the specified object as a key of one of the key/value pairs.
`Enumeration` | `elements()` Answers an Enumeration on the values of this Hashtable.
`Object` | `get(Object key)` Answers the value associated with the specified key in this Hashtable.
`Enumeration` | `keys()` Answers an Enumeration on the keys of this Hashtable.
`Object` | `put(Object key, Object value)` Associate the specified value with the specified key in this Hashtable.
`protected void` | `rehash()` Increases the capacity of this Hashtable.
`Object` | `remove(Object key)` Remove the key/value pair with the specified key from this Hashtable.
`int` | `size()` Answers the number of key/value pairs in this Hashtable.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Hashtable

    public Hashtable()

  Constructs a new Hashtable using the default capacity and load factor.

### Hashtable

    public Hashtable(int capacity)

  Constructs a new Hashtable using the specified capacity and the default load factor.
  Parameters:
    `capacity` - the initial capacity

Method Detail

### clear

    public void clear()

  Removes all key/value pairs from this Hashtable, leaving the size zero and the capacity unchanged.
  See Also:
    `#isEmpty`, `size()`

### clone

    public Object clone()

  Answers a new Hashtable with the same key/value pairs, capacity and load factor.
  Overrides:
    clone in class Object
  Returns:
    a shallow copy of this Hashtable
  See Also:
    `Cloneable`

### contains

    public boolean contains(Object value)

  Answers if this Hashtable contains the specified object as the value of at least one of the key/value pairs.
  Parameters:
    `value` - the object to look for as a value in this Hashtable
  Returns:
    true if object is a value in this Hashtable, false otherwise
  See Also:
    `containsKey(java.lang.Object)`, `Object.equals(java.lang.Object)`

### containsKey

    public boolean containsKey(Object key)

  Answers if this Hashtable contains the specified object as a key of one of the key/value pairs.
  Parameters:
    `key` - the object to look for as a key in this Hashtable
  Returns:
    true if object is a key in this Hashtable, false otherwise
  See Also:
    `contains(java.lang.Object)`, `Object.equals(java.lang.Object)`

### elements

    public Enumeration elements()

  Answers an Enumeration on the values of this Hashtable. The results of the Enumeration may be affected if the contents of this Hashtable are modified.
  Returns:
    an Enumeration of the values of this Hashtable
  See Also:
    `keys()`, `size()`, `Enumeration`

### get

    public Object get(Object key)

  Answers the value associated with the specified key in this Hashtable.
  Parameters:
    `key` - the key of the value returned
  Returns:
    the value associated with the specified key, null if the specified key does not exist
  See Also:
    `put(java.lang.Object, java.lang.Object)`

### keys

    public Enumeration keys()

  Answers an Enumeration on the keys of this Hashtable. The results of the Enumeration may be affected if the contents of this Hashtable are modified.
  Returns:
    an Enumeration of the keys of this Hashtable
  See Also:
    `elements()`, `size()`, `Enumeration`

### put

    public Object put(Object key,
                      Object value)

  Associate the specified value with the specified key in this Hashtable. If the key already exists, the old value is replaced. The key and value cannot be null.
  Parameters:
    `key` - the key to add
    `value` - the value to add
  Returns:
    the old value associated with the specified key, null if the key did not exist
  See Also:
    `elements()`, `get(java.lang.Object)`, `keys()`, `Object.equals(java.lang.Object)`

### rehash

    protected void rehash()

  Increases the capacity of this Hashtable. This method is sent when the size of this Hashtable exceeds the load factor.

### remove

    public Object remove(Object key)

  Remove the key/value pair with the specified key from this Hashtable.
  Parameters:
    `key` - the key to remove
  Returns:
    the value associated with the specified key, null if the specified key did not exist
  See Also:
    `get(java.lang.Object)`, `put(java.lang.Object, java.lang.Object)`

### size

    public int size()

  Answers the number of key/value pairs in this Hashtable.
  Returns:
    the number of key/value pairs in this Hashtable
  See Also:
    `elements()`, `keys()`

Overview | Package | Class | Tree | Deprecated | Index | Help
| EJCL Xtreme for PalmOS
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

@ 1.1.1.1 log @import initial @ text @@