com.ibm.itim.common
Class AttributeValues

java.lang.Object
  |
  +--com.ibm.itim.common.AttributeValues
All Implemented Interfaces:
java.io.Serializable

public class AttributeValues
extends java.lang.Object
implements java.io.Serializable

Contains a map of AttributeValue objects. The keys are the names of the AttribtueValue objects converted to lower case. Case is ignored in storing and looking up objects in the map.

Author:
AAmies
See Also:
Serialized Form

Constructor Summary
AttributeValues()
          Creates new AttributeValues with no entries
AttributeValues(AttributeValues attributeValues)
          Creates new AttributeValues with the given AttributeValues object.
AttributeValues(java.util.Collection attributeValueCollection)
          Creates new AttributeValues with the entries in the collection
AttributeValues(java.util.Map attributeValues)
          Creates new AttributeValues with the given map.
 
Method Summary
 java.lang.Object clone()
          This method returns a deep copy of the underlying map of AttributeValue objects
 void combine(AttributeValues attributeValues)
          Combines the values in this AttributeValues object with the given AttributeValues object
 boolean containsKey(java.lang.String name)
          Determine whether an AttributeValue object exists in the map
 boolean equals(java.lang.Object attributeValues)
          Determines if this object is equivalent to the given set of AttributeValue objects.
 AttributeValue get(java.lang.String name)
          Get an AttributeValue from the map with the given name.
 java.util.Map getMap()
          Returns the Map of AttributeValue objects.
 int hashCode()
          Override the method from java.lang.Object.
 boolean isEmpty()
          Determines whether the collection of AttributeValues is empty
 AttributeValueIterator iterator()
          Get an iterator to iterate over AttributeValue's in the map
 void put(AttributeValue attributeValue)
          Adds an AttributeValue object to the Map
 void remove(java.lang.String name)
          Remove an AttributeValue object from the map
 int size()
           
 java.lang.String toString()
          Overrides Object.toString()
 java.util.Collection values()
          Gets a collection of all the values in the map
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributeValues

public AttributeValues()
Creates new AttributeValues with no entries

AttributeValues

public AttributeValues(AttributeValues attributeValues)
Creates new AttributeValues with the given AttributeValues object. Makes a copy of that object's map.

AttributeValues

public AttributeValues(java.util.Map attributeValues)
Creates new AttributeValues with the given map. Makes a copy of the given map.

AttributeValues

public AttributeValues(java.util.Collection attributeValueCollection)
Creates new AttributeValues with the entries in the collection
Parameters:
attributeValueCollection - A collection of AttributeValue objects
Method Detail

combine

public void combine(AttributeValues attributeValues)
Combines the values in this AttributeValues object with the given AttributeValues object
Parameters:
attributeValues - Add AttributeValue object from this parameter to this object

put

public void put(AttributeValue attributeValue)
Adds an AttributeValue object to the Map
Parameters:
attributeValue - The object to add to the map

get

public AttributeValue get(java.lang.String name)
Get an AttributeValue from the map with the given name. The name is case insensitive.
Parameters:
name - The name of the attribute to retrieve from the map
Returns:
The AttributeValue in the map or null if the name was null

iterator

public AttributeValueIterator iterator()
Get an iterator to iterate over AttributeValue's in the map
Returns:
an iterator

containsKey

public boolean containsKey(java.lang.String name)
Determine whether an AttributeValue object exists in the map
Parameters:
name - The name of the attribute to retrieve from the map
Returns:
True if the AttributeValue object is present

remove

public void remove(java.lang.String name)
Remove an AttributeValue object from the map
Parameters:
name - The name of the attribute to retrieve from the map

values

public java.util.Collection values()
Gets a collection of all the values in the map
Returns:
Collection of AttributeValue objects

getMap

public java.util.Map getMap()
Returns the Map of AttributeValue objects.
Returns:
Map of AttributeValue objects

equals

public boolean equals(java.lang.Object attributeValues)
Determines if this object is equivalent to the given set of AttributeValue objects. Empty attribute values are treated as equivalent to attributes that are not present.
Overrides:
equals in class java.lang.Object
Parameters:
attributeValues - The set of AttributeValues to compare to
Returns:
true if the two sets are equal

hashCode

public int hashCode()
Override the method from java.lang.Object.
Overrides:
hashCode in class java.lang.Object
Returns:
the sum of the hashCodes of the elements

isEmpty

public boolean isEmpty()
Determines whether the collection of AttributeValues is empty
Returns:
True if there are no elements in the collection

toString

public java.lang.String toString()
Overrides Object.toString()
Overrides:
toString in class java.lang.Object
Returns:
A string listing all the AttributeValues in the collection

size

public int size()

clone

public java.lang.Object clone()
This method returns a deep copy of the underlying map of AttributeValue objects
Returns:
exact copy of this object