FreeHEP API
Version current

org.freehep.util
Class DoubleHashtable

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byorg.freehep.util.DoubleHashtable
All Implemented Interfaces:
Collection, Serializable

public class DoubleHashtable
extends AbstractCollection
implements Serializable

Stores a hashtable of hashtables, which can be indexed by a key and a subkey. Keys and Values can be null.

Version:
$Id: DoubleHashtable.java,v 1.2 2003/04/04 00:02:16 duns Exp $
Author:
Mark Donszelmann
See Also:
Serialized Form
Source Code:
DoubleHashtable.java

Constructor Summary
DoubleHashtable()
          creates a hashtable of hashtables
 
Method Summary
 void clear()
          removes all entries and sub-tables
 void clear(Object key)
          removes all entries from a subtable
 Object clone()
           
 boolean contains(Object value)
           
 boolean containsKey(Object key)
           
 boolean containsKey(Object key, Object subKey)
           
 Enumeration elements()
           
 Hashtable get(Object key)
           
 Object get(Object key, Object subKey)
           
 boolean isEmpty()
           
 Iterator iterator()
           
 Enumeration keys()
           
 Enumeration keys(Object key)
           
 Object put(Object key, Object subKey, Object value)
          puts a value in sub-table specified by key and subkey.
 Object remove(Object key, Object subKey)
          removes value from sub-table specified by key and subkey.
 int size()
           
 String toString()
           
 
Methods inherited from class java.util.AbstractCollection
add, addAll, containsAll, remove, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

DoubleHashtable

public DoubleHashtable()
creates a hashtable of hashtables

Method Detail

clear

public void clear()
removes all entries and sub-tables

Specified by:
clear in interface Collection

clear

public void clear(Object key)
removes all entries from a subtable


clone

public Object clone()
             throws CloneNotSupportedException
Throws:
CloneNotSupportedException

contains

public boolean contains(Object value)
Specified by:
contains in interface Collection
Returns:
true if value exists in some sub-table

containsKey

public boolean containsKey(Object key)
Returns:
true if sub-table exists for key

containsKey

public boolean containsKey(Object key,
                           Object subKey)
Returns:
true if value exists for key and subkey

elements

public Enumeration elements()
Returns:
enumeration over all values in all sub-tables

iterator

public Iterator iterator()
Specified by:
iterator in interface Collection
Returns:
iterator over all values in all sub-tables

get

public Hashtable get(Object key)
Returns:
sub-table for key

get

public Object get(Object key,
                  Object subKey)
Returns:
value for key and subkey, null in non-existent or null value was stored

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection
Returns:
true if table is empty

keys

public Enumeration keys()
Returns:
enumeration of keys in table

keys

public Enumeration keys(Object key)
Returns:
enumeration in subkeys of sub-table pointed by key, and empty if sub-table does not exist

put

public Object put(Object key,
                  Object subKey,
                  Object value)
puts a value in sub-table specified by key and subkey.

Returns:
previous value

remove

public Object remove(Object key,
                     Object subKey)
removes value from sub-table specified by key and subkey.

Returns:
previous value

size

public int size()
Specified by:
size in interface Collection
Returns:
size of all tables

toString

public String toString()
Returns:
a string representation of the table

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.