com.tivoli.pd.jutil
Class PDAttrValueList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by com.tivoli.pd.jutil.PDAttrValueList
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

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

This class represents a list of Security Access Manager attribute values. Each value may be a String, a byte array, a Long, or a PDAdmSvcPobj.

Modes: Local,Remote

See Also:
Serialized Form

Constructor Summary
PDAttrValueList(PDBasicContext context)
          Constructs an empty list
PDAttrValueList(PDBasicContext context, java.util.Collection c)
          Constructs a new PDAttrValueList containing the elements in the specified Collection.
 
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 a higher index.
 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 a higher index.
 java.lang.Object clone()
          Returns 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()
          Returns a String representation of this object.
 
Methods inherited from class java.util.ArrayList
clear, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, 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, removeAll, retainAll, subList
 

Constructor Detail

PDAttrValueList

public PDAttrValueList(PDBasicContext context)
                throws PDException
Constructs an empty list

Parameters:
context - the context that defines values for logging and tracing. Cannot be null.
Throws:
PDException - if an error occurs. This exception may contain error and message codes defined in the product Error Message Reference document.

PDAttrValueList

public PDAttrValueList(PDBasicContext context,
                       java.util.Collection c)
                throws PDException
Constructs a new PDAttrValueList containing the elements in the specified Collection.

Parameters:
context - the context that defines values for logging and tracing. Cannot be null.
c - the collection whose elements are to be placed into this list.
Throws:
PDException - if one or more of the elements in the Collection to be added are not PDAttrValue objects, or if no Collection is supplied. This exception may contain error and message codes defined in the product Error Message Reference document.
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.

Specified by:
set in interface java.util.List
Overrides:
set in class java.util.ArrayList
Parameters:
index - the position where the element is to be placed.
element - the replacement element.
Throws:
ClassCastExcepion - if the element to be replaced is not a PDAttrValue object.

add

public 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. This method will throw an PDException if called with an object other than a PDAttrValue.

Specified by:
add in interface java.util.Collection
Specified by:
add in interface java.util.List
Overrides:
add in class java.util.ArrayList
Parameters:
element - 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 a higher index.

Specified by:
add in interface java.util.List
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 PDException is thrown.

Specified by:
addAll in interface java.util.Collection
Specified by:
addAll in interface java.util.List
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 a higher index. 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 non-empty.) 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 PDException is thrown.

Specified by:
addAll in interface java.util.List
Overrides:
addAll in class java.util.ArrayList
Parameters:
index - the position where the collection elements are to be inserted.
c - The collection of PDAttrValue to insert into this PDAttrValueList.
Returns:
true if this Collection changed as a result of the call.
Throws:
java.lang.NullPointerException - if no Collection is supplied.
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.

Specified by:
equals in interface java.util.Collection
Specified by:
equals in interface java.util.List
Overrides:
equals in class java.util.AbstractList
Parameters:
obj - the object to be compared to this one.
Returns:
true if the PDAttrValueLists are identical, false otherwise.

clone

public java.lang.Object clone()
Returns a clone of this object. This is implemented as a deep copy.

Overrides:
clone in class java.util.ArrayList

toString

public java.lang.String toString()
Returns a String representation of this object.

Overrides:
toString in class java.util.AbstractCollection

hashCode

public int hashCode()
Returns a hashcode for the current object.

Specified by:
hashCode in interface java.util.Collection
Specified by:
hashCode in interface java.util.List
Overrides:
hashCode in class java.util.AbstractList