org.bsf.smartValueObject.container
Class SmartList

java.lang.Object
  |
  +--org.bsf.smartValueObject.container.AbstractSmartContainer
        |
        +--org.bsf.smartValueObject.container.SmartList
All Implemented Interfaces:
java.util.Collection, java.util.List, java.io.Serializable, SmartContainer, Versionable

public class SmartList
extends AbstractSmartContainer
implements java.util.List

A smart wrapper class around java.util.List.

See Also:
SmartContainer, List, Serialized Form

Field Summary
private  java.util.List list
           
 
Fields inherited from class org.bsf.smartValueObject.container.AbstractSmartContainer
 
Constructor Summary
SmartList(java.util.List list, org.bsf.smartValueObject.Versionable v)
           
 
Method Summary
 void add(int index, java.lang.Object element)
           
 boolean addAll(java.util.Collection c)
           
 boolean addAll(int index, java.util.Collection c)
           
protected  boolean addToContainer(java.lang.Object o)
          Add object to container.
protected  java.lang.Object addToContainer(java.lang.Object key, java.lang.Object o)
          Adds object to container with key.
protected  void containerClear()
          Deletes all elements from the container.
protected  boolean containerContains(java.lang.Object o)
          Verifies if the container has the specified object.
protected  boolean containerContainsKey(java.lang.Object key)
          Verifies if the container has the specified key.
protected  java.util.Iterator containerIterator()
          Gets the standard iterator for this container.
protected  int containerSize()
          The 'raw' size of the container.
 boolean containsAll(java.util.Collection c)
           
 java.lang.Object get(int index)
           
 java.lang.Object getContainer()
          Gets the backing container containing all elements.
protected  java.lang.Object getFromContainer(java.lang.Object key)
          Gets object from container.
 int indexOf(java.lang.Object o)
           
 int lastIndexOf(java.lang.Object o)
           
 java.util.ListIterator listIterator()
           
 java.util.ListIterator listIterator(int index)
           
 java.lang.Object remove(int index)
           
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection c)
           
protected  boolean removeFromContainer(java.lang.Object o)
          Removes object from container.
protected  java.lang.Object removeKeyFromContainer(java.lang.Object key)
          Removes key from container.
 boolean retainAll(java.util.Collection c)
           
 java.lang.Object set(int index, java.lang.Object element)
           
 java.util.List subList(int fromIndex, int toIndex)
           
protected  java.lang.Object[] toObjectArray()
          Retrieves objects as an array.
 
Methods inherited from class org.bsf.smartValueObject.container.AbstractSmartContainer
add, addObject, addObject, clear, contains, containsKey, containsObject, containsValue, create, delete, get, getCreated, getDeleted, getIterator, getVersionId, isCreated, isDeleted, isDirty, isEmpty, iterator, markClean, put, removeObject, removeObjectByKey, setVersionId, size, toArray, toArray, touch, touch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.List
add, clear, contains, equals, hashCode, isEmpty, iterator, size, toArray, toArray
 

Field Detail

list

private java.util.List list
Constructor Detail

SmartList

public SmartList(java.util.List list,
                 org.bsf.smartValueObject.Versionable v)
Method Detail

addToContainer

protected boolean addToContainer(java.lang.Object o)
Description copied from class: AbstractSmartContainer
Add object to container.

Specified by:
addToContainer in class AbstractSmartContainer
Parameters:
o - the object to be added.
Returns:

addToContainer

protected java.lang.Object addToContainer(java.lang.Object key,
                                          java.lang.Object o)
Description copied from class: AbstractSmartContainer
Adds object to container with key.

Specified by:
addToContainer in class AbstractSmartContainer
Parameters:
key - the key to use.
o - the object to be added.
Returns:

getFromContainer

protected java.lang.Object getFromContainer(java.lang.Object key)
Description copied from class: AbstractSmartContainer
Gets object from container.

Specified by:
getFromContainer in class AbstractSmartContainer
Parameters:
key - the key of the object.
Returns:

removeFromContainer

protected boolean removeFromContainer(java.lang.Object o)
Description copied from class: AbstractSmartContainer
Removes object from container.

Specified by:
removeFromContainer in class AbstractSmartContainer
Parameters:
o - the object to be removed.
Returns:

removeKeyFromContainer

protected java.lang.Object removeKeyFromContainer(java.lang.Object key)
Description copied from class: AbstractSmartContainer
Removes key from container.

Specified by:
removeKeyFromContainer in class AbstractSmartContainer
Parameters:
key - the key to be removed.
Returns:

containerContains

protected boolean containerContains(java.lang.Object o)
Description copied from class: AbstractSmartContainer
Verifies if the container has the specified object.

Specified by:
containerContains in class AbstractSmartContainer
Parameters:
o -
Returns:

containerContainsKey

protected boolean containerContainsKey(java.lang.Object key)
Description copied from class: AbstractSmartContainer
Verifies if the container has the specified key.

Specified by:
containerContainsKey in class AbstractSmartContainer
Parameters:
key -
Returns:

containerSize

protected int containerSize()
Description copied from class: AbstractSmartContainer
The 'raw' size of the container.

Specified by:
containerSize in class AbstractSmartContainer
Returns:
size of the container.

containerIterator

protected java.util.Iterator containerIterator()
Description copied from class: AbstractSmartContainer
Gets the standard iterator for this container.

Specified by:
containerIterator in class AbstractSmartContainer
Returns:
iterator.

containerClear

protected void containerClear()
Description copied from class: AbstractSmartContainer
Deletes all elements from the container.

Specified by:
containerClear in class AbstractSmartContainer

toObjectArray

protected java.lang.Object[] toObjectArray()
Description copied from class: AbstractSmartContainer
Retrieves objects as an array.

Specified by:
toObjectArray in class AbstractSmartContainer
Returns:

getContainer

public java.lang.Object getContainer()
Description copied from interface: SmartContainer
Gets the backing container containing all elements.

Specified by:
getContainer in interface SmartContainer
Specified by:
getContainer in class AbstractSmartContainer
Returns:
the underlying container.

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.List

containsAll

public boolean containsAll(java.util.Collection c)
Specified by:
containsAll in interface java.util.List

addAll

public boolean addAll(java.util.Collection c)
Specified by:
addAll in interface java.util.List

addAll

public boolean addAll(int index,
                      java.util.Collection c)
Specified by:
addAll in interface java.util.List

removeAll

public boolean removeAll(java.util.Collection c)
Specified by:
removeAll in interface java.util.List

retainAll

public boolean retainAll(java.util.Collection c)
Specified by:
retainAll in interface java.util.List

get

public java.lang.Object get(int index)
Specified by:
get in interface java.util.List

set

public java.lang.Object set(int index,
                            java.lang.Object element)
Specified by:
set in interface java.util.List

add

public void add(int index,
                java.lang.Object element)
Specified by:
add in interface java.util.List

remove

public java.lang.Object remove(int index)
Specified by:
remove in interface java.util.List

indexOf

public int indexOf(java.lang.Object o)
Specified by:
indexOf in interface java.util.List

lastIndexOf

public int lastIndexOf(java.lang.Object o)
Specified by:
lastIndexOf in interface java.util.List

listIterator

public java.util.ListIterator listIterator()
Specified by:
listIterator in interface java.util.List

listIterator

public java.util.ListIterator listIterator(int index)
Specified by:
listIterator in interface java.util.List

subList

public java.util.List subList(int fromIndex,
                              int toIndex)
Specified by:
subList in interface java.util.List