com.tivoli.mts
Class PDAttrValues

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractSet
              |
              +--java.util.HashSet
                    |
                    +--com.tivoli.mts.PDAttrValues
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.io.Serializable, java.util.Set

public class PDAttrValues
extends java.util.HashSet
implements java.lang.Cloneable, java.io.Serializable

This class represents a collection of values for a particular PDAttr. This particular implementation is a Set, so duplicates are not allowed in a particular PDAttrValues object.

Since:
PD 3.8
See Also:
Serialized Form

Constructor Summary
PDAttrValues()
          Constructs a new, empty set; the backing HashMap instance has default capacity and load factor, which is 0.75.
PDAttrValues(java.util.Collection c)
          Constructs a new Set containing the elements in the specified Collection.
PDAttrValues(int initialCapacity)
          Constructs a new, empty set; the backing HashMap instance has the specified initial capacity and default load factor, which is 0.75.
PDAttrValues(int initialCapacity, float loadFactor)
          Constructs a new, empty set; the backing HashMap instance has the specified initial capacity and the specified load factor.
 
Method Summary
 boolean add(java.lang.Object obj)
          Overrides the generic method in HashSet that allows objects of any type to be added to a Set.
 boolean add(PDAttrValue value)
          Adds the input PDAttrValue to this PDAttrValues.
 boolean addAll(java.util.Collection c)
          Adds all of the elements in the specified collection to this collection.
 java.lang.Object clone()
          Return a clone of this object.
 boolean equals(java.lang.Object obj)
          Indicates whether some other Object is equal to this one.
 int hashCode()
          Returns a hashcode for the current object.
 java.lang.String toString()
          Return a string version of this object.
 
Methods inherited from class java.util.HashSet
clear, contains, isEmpty, iterator, remove, size
 
Methods inherited from class java.util.AbstractSet
removeAll
 
Methods inherited from class java.util.AbstractCollection
containsAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
containsAll, removeAll, retainAll, toArray, toArray
 

Constructor Detail

PDAttrValues

public PDAttrValues()
Constructs a new, empty set; the backing HashMap instance has default capacity and load factor, which is 0.75.

PDAttrValues

public PDAttrValues(int initialCapacity)
Constructs a new, empty set; the backing HashMap instance has the specified initial capacity and default load factor, which is 0.75.

PDAttrValues

public PDAttrValues(int initialCapacity,
                    float loadFactor)
Constructs a new, empty set; the backing HashMap instance has the specified initial capacity and the specified load factor.

PDAttrValues

public PDAttrValues(java.util.Collection c)
             throws java.lang.IllegalArgumentException
Constructs a new Set containing the elements in the specified Collection.
Parameters:
c - the collection whose elements are to be placed into this set
Throws:
java.lang.NullPointerException - if no Collection is passed in
java.lang.ClassCastException - if one or more of the elements in the Collection to be added are not PDAttrValue objects
Method Detail

add

public boolean add(PDAttrValue value)
            throws java.lang.NullPointerException
Adds the input PDAttrValue to this PDAttrValues. If a PDAttrValue with the same value is already in the Set, the input PDAttrValue will replace it.
Parameters:
value - the value to be added
Returns:
true if this Collection changed as a result of this call
Throws:
java.lang.NullPointerException - if no PDAttrValue is supplied

add

public boolean add(java.lang.Object obj)
            throws java.lang.IllegalArgumentException
Overrides the generic method in HashSet that allows objects of any type to be added to a Set. This method will throw an IllegalArgumentException if called with an object other than a PDAttrValue.
Overrides:
add in class java.util.HashSet
Throws:
java.lang.IllegalArgumentException - if called

addAll

public boolean addAll(java.util.Collection c)
               throws java.lang.NullPointerException,
                      java.lang.ClassCastException
Adds all of the elements in the specified collection to this collection. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified collection is this collection, and this collection is nonempty.) This implementation iterates over the specified collection, and adds each PDAttrValue returned by the iterator to this collection, in turn. If any objects are returned by the iterator that are not PDAttrValue, a ClassCastException is thrown.
Overrides:
addAll in class java.util.AbstractCollection
Returns:
true if this Collection changed as a result of the call
Throws:
java.lang.NullPointerException - if no Collection is passed
java.lang.ClassCastException - if the input Collection contains an object other than a PDAttrValue

clone

public java.lang.Object clone()
Return a clone of this object. This is implemented as a deep copy.
Overrides:
clone in class java.util.HashSet
Returns:
a clone of this object

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other Object is equal to this one. In particular, this implementation checks that the object is a PDAttrValues, and then defers to the HashSet.equals check, which will devolve into a containsAll check on the current set of PDAttrValues.
Overrides:
equals in class java.util.AbstractSet
Parameters:
obj - the object to be compared to this one
Returns:
true if the PDAttrValues are identical, false otherwise.

toString

public java.lang.String toString()
Return a string version of this object.
Overrides:
toString in class java.util.AbstractCollection
Returns:
a String representing this object

hashCode

public int hashCode()
Returns a hashcode for the current object.
Overrides:
hashCode in class java.util.AbstractSet
Returns:
a hashcode for the current object.