org.freehep.util
Class DoubleHashtable
- java.lang.Object
-
- java.util.AbstractCollection
-
- org.freehep.util.DoubleHashtable
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Iterable, java.util.Collection
public class DoubleHashtable extends java.util.AbstractCollection implements java.io.SerializableStores a hashtable of hashtables, which can be indexed by a key and a subkey. Keys and Values can be null.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description DoubleHashtable()creates a hashtable of hashtables
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclear()removes all entries and sub-tablesvoidclear(java.lang.Object key)removes all entries from a subtablejava.lang.Objectclone()booleancontains(java.lang.Object value)booleancontainsKey(java.lang.Object key)booleancontainsKey(java.lang.Object key, java.lang.Object subKey)java.util.Enumerationelements()java.util.Hashtableget(java.lang.Object key)java.lang.Objectget(java.lang.Object key, java.lang.Object subKey)booleanisEmpty()java.util.Iteratoriterator()java.util.Enumerationkeys()java.util.Enumerationkeys(java.lang.Object key)java.lang.Objectput(java.lang.Object key, java.lang.Object subKey, java.lang.Object value)puts a value in sub-table specified by key and subkey.java.lang.Objectremove(java.lang.Object key, java.lang.Object subKey)removes value from sub-table specified by key and subkey.intsize()java.lang.StringtoString()-
Methods inherited from class java.util.AbstractCollection
add, addAll, containsAll, remove, removeAll, retainAll, toArray, toArray
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
clear
public void clear()
removes all entries and sub-tables- Specified by:
clearin interfacejava.util.Collection- Overrides:
clearin classjava.util.AbstractCollection
-
clear
public void clear(java.lang.Object key)
removes all entries from a subtable
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException- Overrides:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-
contains
public boolean contains(java.lang.Object value)
- Specified by:
containsin interfacejava.util.Collection- Overrides:
containsin classjava.util.AbstractCollection- Returns:
- true if value exists in some sub-table
-
containsKey
public boolean containsKey(java.lang.Object key)
- Returns:
- true if sub-table exists for key
-
containsKey
public boolean containsKey(java.lang.Object key, java.lang.Object subKey)- Returns:
- true if value exists for key and subkey
-
elements
public java.util.Enumeration elements()
- Returns:
- enumeration over all values in all sub-tables
-
iterator
public java.util.Iterator iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable- Specified by:
iteratorin interfacejava.util.Collection- Specified by:
iteratorin classjava.util.AbstractCollection- Returns:
- iterator over all values in all sub-tables
-
get
public java.util.Hashtable get(java.lang.Object key)
- Returns:
- sub-table for key
-
get
public java.lang.Object get(java.lang.Object key, java.lang.Object subKey)- Returns:
- value for key and subkey, null in non-existent or null value was stored
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Collection- Overrides:
isEmptyin classjava.util.AbstractCollection- Returns:
- true if table is empty
-
keys
public java.util.Enumeration keys()
- Returns:
- enumeration of keys in table
-
keys
public java.util.Enumeration keys(java.lang.Object key)
- Returns:
- enumeration in subkeys of sub-table pointed by key, and empty if sub-table does not exist
-
put
public java.lang.Object put(java.lang.Object key, java.lang.Object subKey, java.lang.Object value)puts a value in sub-table specified by key and subkey.- Returns:
- previous value
-
remove
public java.lang.Object remove(java.lang.Object key, java.lang.Object subKey)removes value from sub-table specified by key and subkey.- Returns:
- previous value
-
size
public int size()
- Specified by:
sizein interfacejava.util.Collection- Specified by:
sizein classjava.util.AbstractCollection- Returns:
- size of all tables
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.util.AbstractCollection- Returns:
- a string representation of the table
-
-
DMelt 3.0 © DataMelt by jWork.ORG