org.enhydra.barracuda.core.util.data
Class PHashMap

java.lang.Object
  |
  +--org.enhydra.barracuda.core.util.data.AbstractPData
        |
        +--org.enhydra.barracuda.core.util.data.PHashMap
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, PData, PMap, java.io.Serializable, StateMap

public class PHashMap
extends AbstractPData
implements PMap

This class extends AbstractPData (which provides the parental/statemap functionality) and delegates most of the Map functionality back to an underlying HashMap

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
 
Fields inherited from class org.enhydra.barracuda.core.util.data.AbstractPData
inheritParents, parent, state
 
Constructor Summary
PHashMap()
           
 
Method Summary
 void clear()
          Removes all mappings from this map (optional operation).
 java.lang.Object clone()
          Returns a shallow copy of this ArrayList instance.
 boolean containsKey(java.lang.Object key)
          Returns true if this map contains a mapping for the specified key.
 boolean containsValue(java.lang.Object value)
          Returns true if this map maps one or more keys to the specified value.
 java.util.Set entrySet()
          Returns a set view of the mappings contained in this map.
 boolean equals(java.lang.Object obj)
          Check object for equality.
 java.lang.Object get(java.lang.Object key)
          Returns the value to which this map maps the specified key.
 int hashCode()
          Returns the hash code value for this list.
 boolean isEmpty()
          Returns true if this map contains no key-value mappings.
 java.util.Set keySet()
          Returns a set view of the keys contained in this map.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Associates the specified value with the specified key in this map (optional operation).
 void putAll(java.util.Map imap)
          Copies all of the mappings from the specified map to this map (optional operation).
 java.lang.Object remove(java.lang.Object key)
          Removes the mapping for this key from this map if present (optional operation).
 void setStore(java.util.Map imap)
          Set the underlying store (you only really need to use this method if you want to store the data in something other than a HashMap, which is the default)
 int size()
          Returns the number of key-value mappings in this map.
 java.util.Collection values()
          Returns a collection view of the values contained in this map.
 
Methods inherited from class org.enhydra.barracuda.core.util.data.AbstractPData
getParent, getRootParent, getState, getStateKeys, getStateValues, isInheritParents, putState, removeState, setInheritParents, setParent
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.enhydra.barracuda.core.util.data.PData
getParent, getRootParent, isInheritParents, setInheritParents, setParent
 
Methods inherited from interface org.enhydra.barracuda.core.util.data.StateMap
getState, getStateKeys, getStateValues, putState, removeState
 

Constructor Detail

PHashMap

public PHashMap()
Method Detail

setStore

public void setStore(java.util.Map imap)
Set the underlying store (you only really need to use this method if you want to store the data in something other than a HashMap, which is the default)


clear

public void clear()
Removes all mappings from this map (optional operation).

Specified by:
clear in interface java.util.Map

containsKey

public boolean containsKey(java.lang.Object key)
Returns true if this map contains a mapping for the specified key.

Specified by:
containsKey in interface java.util.Map

containsValue

public boolean containsValue(java.lang.Object value)
Returns true if this map maps one or more keys to the specified value.

Specified by:
containsValue in interface java.util.Map

entrySet

public java.util.Set entrySet()
Returns a set view of the mappings contained in this map.

Specified by:
entrySet in interface java.util.Map

get

public java.lang.Object get(java.lang.Object key)
Returns the value to which this map maps the specified key.

Specified by:
get in interface java.util.Map

isEmpty

public boolean isEmpty()
Returns true if this map contains no key-value mappings.

Specified by:
isEmpty in interface java.util.Map

keySet

public java.util.Set keySet()
Returns a set view of the keys contained in this map.

Specified by:
keySet in interface java.util.Map

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Associates the specified value with the specified key in this map (optional operation).

Specified by:
put in interface java.util.Map

putAll

public void putAll(java.util.Map imap)
Copies all of the mappings from the specified map to this map (optional operation).

Specified by:
putAll in interface java.util.Map

remove

public java.lang.Object remove(java.lang.Object key)
Removes the mapping for this key from this map if present (optional operation).

Specified by:
remove in interface java.util.Map

size

public int size()
Returns the number of key-value mappings in this map.

Specified by:
size in interface java.util.Map

values

public java.util.Collection values()
Returns a collection view of the values contained in this map.

Specified by:
values in interface java.util.Map

clone

public java.lang.Object clone()
Returns a shallow copy of this ArrayList instance. (The elements themselves are not copied.)

Overrides:
clone in class java.lang.Object
Returns:
a clone of this ArrayList instance.

equals

public boolean equals(java.lang.Object obj)
Check object for equality. Will return true if the incoming object is a) non-null, b) the size of the underlying list structures is the same and c) the list containsAll() the same elements

Specified by:
equals in interface java.util.Map
Overrides:
equals in class java.lang.Object
Parameters:
obj - the object we're comparing against
Returns:
true if the objects are equal

hashCode

public int hashCode()
Returns the hash code value for this list.

Specified by:
hashCode in interface java.util.Map
Overrides:
hashCode in class java.lang.Object


Copyright © 2001 Enhydra.org