org.enhydra.barracuda.plankton.data
Class PArrayList

java.lang.Object
  extended byorg.enhydra.barracuda.plankton.data.AbstractPData
      extended byorg.enhydra.barracuda.plankton.data.PArrayList
All Implemented Interfaces:
Cloneable, Collection, List, PData, PList, 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.plankton.data.AbstractPData
inheritParents, parent, state
 
Constructor Summary
PArrayList()
           
 
Method Summary
 void add(int index, Object el)
          Inserts the specified element at the specified position in this list (optional operation).
 boolean add(Object el)
          Appends the specified element to the end of this list (optional operation).
 boolean addAll(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, 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).
 Object clone()
          Returns a shallow copy of this ArrayList instance.
 boolean contains(Object el)
          Returns true if this list contains the specified element.
 boolean containsAll(Collection c)
          Returns true if this list contains all of the elements of the specified collection.
 boolean equals(Object obj)
          Check object for equality.
 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(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.
 Iterator iterator()
          Returns an iterator over the elements in this list in proper sequence.
 int lastIndexOf(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.
 ListIterator listIterator()
          Returns a list iterator of the elements in this list (in proper sequence).
 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.
 Object remove(int index)
          Removes the element at the specified position in this list (optional operation).
 boolean remove(Object el)
          Removes the first occurrence in this list of the specified element (optional operation).
 boolean removeAll(Collection c)
          Removes from this list all the elements that are contained in the specified collection (optional operation).
 boolean retainAll(Collection c)
          Retains only the elements in this list that are contained in the specified collection (optional operation).
 Object set(int index, Object el)
          Replaces the element at the specified position in this list with the specified element (optional operation).
 void setStore(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.
 List subList(int fromIndex, int toIndex)
          Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.
 Object[] toArray()
          Returns an array containing all of the elements in this list in proper sequence.
 Object[] toArray(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.plankton.data.AbstractPData
clearState, 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.plankton.data.PData
getParent, getRootParent, isInheritParents, setInheritParents, setParent
 
Methods inherited from interface org.enhydra.barracuda.plankton.data.StateMap
clearState, getState, getStateKeys, getStateValues, putState, removeState
 

Constructor Detail

PArrayList

public PArrayList()
Method Detail

setStore

public void setStore(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)

Parameters:
ilist - the List structure to be used as the underlying store

add

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

Specified by:
add in interface List

add

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

Specified by:
add in interface List

addAll

public boolean addAll(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 List

addAll

public boolean addAll(int index,
                      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 List

clear

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

Specified by:
clear in interface List

contains

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

Specified by:
contains in interface List

containsAll

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

Specified by:
containsAll in interface List

get

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

Specified by:
get in interface List

indexOf

public int indexOf(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 List

isEmpty

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

Specified by:
isEmpty in interface List

iterator

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

Specified by:
iterator in interface List

lastIndexOf

public int lastIndexOf(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 List

listIterator

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

Specified by:
listIterator in interface List

listIterator

public 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 List

remove

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

Specified by:
remove in interface List

remove

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

Specified by:
remove in interface List

removeAll

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

Specified by:
removeAll in interface List

retainAll

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

Specified by:
retainAll in interface List

set

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

Specified by:
set in interface List

size

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

Specified by:
size in interface List

subList

public 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 List

toArray

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

Specified by:
toArray in interface List

toArray

public Object[] toArray(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 List

clone

public Object clone()
Returns a shallow copy of this ArrayList instance. (The elements themselves are not copied.)

Returns:
a clone of this ArrayList instance.

equals

public boolean equals(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 List
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 List


Copyright © 2003 BarracudaMVC.org All Rights Reserved.