com.tivoli.mts
Class PDAttrValueList

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.ArrayList
                    |
                    +--com.tivoli.mts.PDAttrValueList
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.io.Serializable

public class PDAttrValueList
extends java.util.ArrayList
implements java.lang.Cloneable, java.io.Serializable

See Also:
Serialized Form

Constructor Summary
PDAttrValueList()
          Constructs an empty list
PDAttrValueList(java.util.Collection c)
          Constructs a new PDAttrValueList containing the elements in the specified Collection.
PDAttrValueList(int size)
          Constructs an empty list with the specified initial capacity.
 
Method Summary
 void add(int index, java.lang.Object element)
          Inserts the specified element at the specified position in this list, moving all subsequent elements to the right
 boolean add(java.lang.Object element)
          Overrides the generic method in ArrayList that allows objects of any type to be added to the end of an ArrayList.
 boolean addAll(java.util.Collection c)
          Adds all of the elements in the specified collection to this collection.
 boolean addAll(int index, java.util.Collection c)
          Inserts all of the elements in the specified collection into this list, starting at the specified offset, shifting any subsequent elements to the right.
 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.Object set(int index, java.lang.Object element)
          Replaces the element at the specified position in this list with the specified element.
 java.lang.String toString()
          Return a string version of this object.
 
Methods inherited from class java.util.ArrayList
clear, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, remove, removeAll, retainAll
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, iterator, listIterator, listIterator, remove, removeAll, retainAll, subList
 

Constructor Detail

PDAttrValueList

public PDAttrValueList()
Constructs an empty list

PDAttrValueList

public PDAttrValueList(int size)
Constructs an empty list with the specified initial capacity.
Parameters:
initialCapacity - the initial capacity of the PDAttrValueList

PDAttrValueList

public PDAttrValueList(java.util.Collection c)
Constructs a new PDAttrValueList containing the elements in the specified Collection.
Parameters:
c - the collection whose elements are to be placed into this list
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

set

public java.lang.Object set(int index,
                            java.lang.Object element)
Replaces the element at the specified position in this list with the specified element.
Overrides:
set in class java.util.ArrayList
Parameters:
index - the position where the element is to be placed
element - the replacement element
Throws:
java.lang.ClassCastException - if the element to be replaced is not a PDAttrValue object

add

public boolean add(java.lang.Object element)
            throws java.lang.IllegalArgumentException
Overrides the generic method in ArrayList that allows objects of any type to be added to the end of an ArrayList. This method will throw an ClassCastException if called with an object other than a PDAttrValue.
Overrides:
add in class java.util.ArrayList
Parameters:
the - element to add to the end of the list
Returns:
true if this Collection changed as a result of this call
Throws:
java.lang.ClassCastException - if called with an object other than a PDAttrValue.

add

public void add(int index,
                java.lang.Object element)
Inserts the specified element at the specified position in this list, moving all subsequent elements to the right
Overrides:
add in class java.util.ArrayList
Parameters:
index - the position where the element is to be inserted
element - the element to insert
Throws:
java.lang.ClassCastException - if the element to be inserted is not a PDAttrValue object

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.ArrayList
Parameters:
c - The collection of PDAttrValue to add to the PDAttrValueList
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

addAll

public boolean addAll(int index,
                      java.util.Collection c)
               throws java.lang.NullPointerException,
                      java.lang.ClassCastException
Inserts all of the elements in the specified collection into this list, starting at the specified offset, shifting any subsequent elements to the right. 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.ArrayList
Parameters:
c - The collection of PDAttrValue to insert into the PDAttrValueList
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

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 PDAttrValueList, and then defers to the HashSet.equals check, which will devolve into a containsAll check on the current PDAttrValueList.
Overrides:
equals in class java.util.AbstractList
Parameters:
obj - the object to be compared to this one
Returns:
true if the PDAttrValues are identical, false otherwise.

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.ArrayList
Returns:
a clone of this object

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.AbstractList
Returns:
a hashcode for the current object.