|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.plumtree.openfoundation.util.XPHashtable
XPHashtable is a wrapper over HashMap and is not synchronized.
XPSynchronizedHashTable
,
IXPDictionary
Field Summary | |
protected java.util.HashMap |
hashMap
The Hashmap used beneath XPHashtable. |
static int |
KEYS
The type argument to GetArray that denotes the key. |
static int |
VALUES
The type argument to GetArray() that denotes the value. |
Constructor Summary | |
XPHashtable()
Creates a new, empty XPHashtable. |
|
XPHashtable(java.util.HashMap map)
Construct an XPHashtable by wrapping the HashMap supplied. |
|
XPHashtable(java.util.Hashtable _hashtable)
Construct a new XPHashtable by copying the keys and values of the supplied Hashtable. |
|
XPHashtable(int capacity)
Creates a new, empty XPHashtable with the specified initial capacity. |
|
XPHashtable(int capacity,
float loadFactor)
Creates a new, empty hashtable with the specified initial capacity and the specified load factor. |
|
XPHashtable(XPHashtable hashtable)
Copy constructor that clones the given XPHashtable. |
Method Summary | |
void |
Clear()
Clears this hashtable so that it contains no keys. |
java.lang.Object |
Clone()
Creates a shallow copy of this hashtable. |
boolean |
Contains(java.lang.Object _value)
Tests if some key maps into the specified value in this hashtable. |
boolean |
ContainsKey(java.lang.Object key)
Tests if the specified object is a key in this hashtable. |
boolean |
ContainsValue(java.lang.Object _value)
Tests if this hashtable maps one or more keys to this value. |
java.lang.Object[] |
GetArray(int type)
Returns an array of keys or values in the hashtable as indicated by the type argument. |
java.lang.Object |
GetElement(java.lang.Object key)
Returns the value to which the specified key is mapped in this hashtable. |
IXPEnumerator |
GetElements()
Returns an XPEnumerator that can iterate through the values in this hashtable. |
IXPDictionaryEnumerator |
GetEnumerator()
Returns IXPDictionaryEnumerator for this dictionary. |
IXPEnumerator |
GetKeys()
Returns an XPEnumerator that can iterate through the keys in this hashtable. |
int |
GetSize()
Returns the number of elements in this hashtable. |
static XPSynchronizedHashtable |
GetSynchronized(XPHashtable hashtable)
Returns a sychronized wrapper of the give XPHashtable. |
java.util.HashMap |
GetUnderlyingObject()
Returns the platfrom specific object that this class wraps. |
boolean |
IsEmpty()
Tests if this hashtable has no elements. |
java.lang.Object |
PutElement(java.lang.Object key,
java.lang.Object _value)
Maps the specified key to the specified value in this hashtable. |
java.lang.Object |
RemoveElement(java.lang.Object key)
Removes the key (and its corresponding value) from this hashtable. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int KEYS
public static final int VALUES
protected java.util.HashMap hashMap
Constructor Detail |
public XPHashtable()
public XPHashtable(java.util.HashMap map)
map
- HashMap supplied for the wrapper XPHashtable.public XPHashtable(java.util.Hashtable _hashtable)
_hashtable
- The Input Hashtable from which the XPHashtable is
constructed.public XPHashtable(int capacity)
capacity
- the initial capacity of the list.public XPHashtable(int capacity, float loadFactor)
capacity
- the initial capactity of the hashtable.loadFactor
- the load factor of the hashtable.public XPHashtable(XPHashtable hashtable)
hashtable
- the Hashtable to be copied into this objectMethod Detail |
public void Clear()
public java.lang.Object Clone()
public boolean Contains(java.lang.Object _value)
_value
- a value to search for.
public boolean ContainsKey(java.lang.Object key)
ContainsKey
in interface IXPDictionary
key
- possible key.
public boolean ContainsValue(java.lang.Object _value)
_value
- value whose presence in this hashtable is to be tested.
public java.lang.Object[] GetArray(int type)
type
- the type of information in the array returned (key or value)
public java.lang.Object GetElement(java.lang.Object key)
GetElement
in interface IXPDictionary
key
- a key in the hashtable.
public IXPEnumerator GetElements()
GetElements
in interface IXPDictionary
public IXPEnumerator GetKeys()
GetKeys
in interface IXPDictionary
public IXPDictionaryEnumerator GetEnumerator()
GetEnumerator
in interface IXPDictionary
public int GetSize()
GetSize
in interface IXPDictionary
public boolean IsEmpty()
public java.lang.Object PutElement(java.lang.Object key, java.lang.Object _value)
PutElement
in interface IXPDictionary
key
- the hashtable key._value
- the value.
public java.lang.Object RemoveElement(java.lang.Object key)
RemoveElement
in interface IXPDictionary
key
- the key that needs to be removed.
public java.util.HashMap GetUnderlyingObject()
public static XPSynchronizedHashtable GetSynchronized(XPHashtable hashtable)
hashtable
- from which a Thread safe XPSynchronizedHashtable to be constructed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |