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

java.lang.Object
  |
  +--org.enhydra.barracuda.core.util.data.AbstractPData
        |
        +--org.enhydra.barracuda.core.util.data.PArrayList
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, PData, PList, java.io.Serializable, StateMap

public class PArrayList
extends AbstractPData
implements PList

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

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.enhydra.barracuda.core.util.data.AbstractPData
inheritParents, parent, state
 
Constructor Summary
PArrayList()
           
 
Method Summary
 void add(int index, java.lang.Object el)
          Inserts the specified element at the specified position in this list (optional operation).
 boolean add(java.lang.Object el)
          Appends the specified element to the end of this list (optional operation).
 boolean addAll(java.util.Collection c)
          Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation).
 boolean addAll(int index, java.util.Collection c)
          Inserts all of the elements in the specified collection into this list at the specified position (optional operation).
 void clear()
          Removes all of the elements from this list (optional operation).
 java.lang.Object clone()
          Returns a shallow copy of this ArrayList instance.
 boolean contains(java.lang.Object el)
          Returns true if this list contains the specified element.
 boolean containsAll(java.util.Collection c)
          Returns true if this list contains all of the elements of the specified collection.
 boolean equals(java.lang.Object obj)
          Check object for equality.
 java.lang.Object get(int index)
          Returns the element at the specified position in this list.
 int hashCode()
          Returns the hash code value for this list.
 int indexOf(java.lang.Object el)
          Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element.
 boolean isEmpty()
          Returns true if this list contains no elements.
 java.util.Iterator iterator()
          Returns an iterator over the elements in this list in proper sequence.
 int lastIndexOf(java.lang.Object el)
          Returns the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element.
 java.util.ListIterator listIterator()
          Returns a list iterator of the elements in this list (in proper sequence).
 java.util.ListIterator listIterator(int index)
          Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in this list.
 java.lang.Object remove(int index)
          Removes the element at the specified position in this list (optional operation).
 boolean remove(java.lang.Object el)
          Removes the first occurrence in this list of the specified element (optional operation).
 boolean removeAll(java.util.Collection c)
          Removes from this list all the elements that are contained in the specified collection (optional operation).
 boolean retainAll(java.util.Collection c)
          Retains only the elements in this list that are contained in the specified collection (optional operation).
 java.lang.Object set(int index, java.lang.Object el)
          Replaces the element at the specified position in this list with the specified element (optional operation).
 void setStore(java.util.List ilist)
          Set the underlying store (you only really need to use this method if you want to store the data in something other than an ArrayList, which is the default)
 int size()
          Returns the number of elements in this list.
 java.util.List subList(int fromIndex, int toIndex)
          Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.
 java.lang.Object[] toArray()
          Returns an array containing all of the elements in this list in proper sequence.
 java.lang.Object[] toArray(java.lang.Object[] a)
          Returns an array containing all of the elements in this list in proper sequence; the runtime type of the returned array is that of the specified array.
 
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

PArrayList

public PArrayList()
Method Detail

setStore

public void setStore(java.util.List ilist)
Set the underlying store (you only really need to use this method if you want to store the data in something other than an ArrayList, which is the default)


add

public void add(int index,
                java.lang.Object el)
Inserts the specified element at the specified position in this list (optional operation).

Specified by:
add in interface java.util.List

add

public boolean add(java.lang.Object el)
Appends the specified element to the end of this list (optional operation).

Specified by:
add in interface java.util.List

addAll

public boolean addAll(java.util.Collection c)
Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation).

Specified by:
addAll in interface java.util.List

addAll

public boolean addAll(int index,
                      java.util.Collection c)
Inserts all of the elements in the specified collection into this list at the specified position (optional operation).

Specified by:
addAll in interface java.util.List

clear

public void clear()
Removes all of the elements from this list (optional operation).

Specified by:
clear in interface java.util.List

contains

public boolean contains(java.lang.Object el)
Returns true if this list contains the specified element.

Specified by:
contains in interface java.util.List

containsAll

public boolean containsAll(java.util.Collection c)
Returns true if this list contains all of the elements of the specified collection.

Specified by:
containsAll in interface java.util.List

get

public java.lang.Object get(int index)
Returns the element at the specified position in this list.

Specified by:
get in interface java.util.List

indexOf

public int indexOf(java.lang.Object el)
Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element.

Specified by:
indexOf in interface java.util.List

isEmpty

public boolean isEmpty()
Returns true if this list contains no elements.

Specified by:
isEmpty in interface java.util.List

iterator

public java.util.Iterator iterator()
Returns an iterator over the elements in this list in proper sequence.

Specified by:
iterator in interface java.util.List

lastIndexOf

public int lastIndexOf(java.lang.Object el)
Returns the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element.

Specified by:
lastIndexOf in interface java.util.List

listIterator

public java.util.ListIterator listIterator()
Returns a list iterator of the elements in this list (in proper sequence).

Specified by:
listIterator in interface java.util.List

listIterator

public java.util.ListIterator listIterator(int index)
Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in this list.

Specified by:
listIterator in interface java.util.List

remove

public java.lang.Object remove(int index)
Removes the element at the specified position in this list (optional operation).

Specified by:
remove in interface java.util.List

remove

public boolean remove(java.lang.Object el)
Removes the first occurrence in this list of the specified element (optional operation).

Specified by:
remove in interface java.util.List

removeAll

public boolean removeAll(java.util.Collection c)
Removes from this list all the elements that are contained in the specified collection (optional operation).

Specified by:
removeAll in interface java.util.List

retainAll

public boolean retainAll(java.util.Collection c)
Retains only the elements in this list that are contained in the specified collection (optional operation).

Specified by:
retainAll in interface java.util.List

set

public java.lang.Object set(int index,
                            java.lang.Object el)
Replaces the element at the specified position in this list with the specified element (optional operation).

Specified by:
set in interface java.util.List

size

public int size()
Returns the number of elements in this list.

Specified by:
size in interface java.util.List

subList

public java.util.List subList(int fromIndex,
                              int toIndex)
Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.

Specified by:
subList in interface java.util.List

toArray

public java.lang.Object[] toArray()
Returns an array containing all of the elements in this list in proper sequence.

Specified by:
toArray in interface java.util.List

toArray

public java.lang.Object[] toArray(java.lang.Object[] a)
Returns an array containing all of the elements in this list in proper sequence; the runtime type of the returned array is that of the specified array.

Specified by:
toArray in interface java.util.List

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.List
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.List
Overrides:
hashCode in class java.lang.Object


Copyright © 2001 Enhydra.org