org.equanda.persistence
Class EquandaList<ELTYPE>

java.lang.Object
  extended by org.equanda.persistence.EquandaList<ELTYPE>
All Implemented Interfaces:
Serializable, Iterable<ELTYPE>, Collection<ELTYPE>, List<ELTYPE>

public class EquandaList<ELTYPE>
extends Object
implements List<ELTYPE>, Serializable

Special list for containing equanda proxies or sfsb entity façades. The list only allows each object to exist once and does not allow nulls. The list has modification detection support and allows easier updates on the original (persisted) lists. Each element stored in the list is enclosed in an ElementWrapper which is used for change detection.

Author:
Joachim Van der Auwera, Andrei Chiritescu
See Also:
Serialized Form

Field Summary
protected  List<org.equanda.persistence.EquandaList.ElementWrapper> list
           
protected  boolean proxySetterUsed
           
 
Constructor Summary
EquandaList()
           
 
Method Summary
 boolean add(ELTYPE element)
           
 void add(int index, ELTYPE element)
           
 boolean addAll(Collection<? extends ELTYPE> coll)
           
 boolean addAll(int index, Collection<? extends ELTYPE> c)
           
 void clear()
           
 EquandaList<ELTYPE> clone()
           
 boolean contains(Object obj)
           
 boolean containsAll(Collection<?> c)
           
 boolean equals(Object o)
           
 ELTYPE get(int index)
           
 Collection<ELTYPE> getRemoveSet()
           
 int hashCode()
           
 int indexOf(Object elem)
           
 boolean isEmpty()
           
 boolean isModified()
           
 Iterator<ELTYPE> iterator()
           
 int lastIndexOf(Object elem)
           
 ListIterator<ELTYPE> listIterator()
           
 ListIterator<ELTYPE> listIterator(int index)
           
 void proxySetterUsed()
           
 ELTYPE remove(int index)
           
 boolean remove(Object element)
           
 boolean removeAll(Collection<?> coll)
           
 void reset()
           
 boolean retainAll(Collection<?> coll)
           
 ELTYPE set(int index, ELTYPE element)
           
 void setRemoveSet(Collection<ELTYPE> coll)
           
 int size()
           
 List<ELTYPE> subList(int fromIndex, int toIndex)
           
 Object[] toArray()
           
<ELTYPE> ELTYPE[]
toArray(ELTYPE[] result)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

list

protected List<org.equanda.persistence.EquandaList.ElementWrapper> list

proxySetterUsed

protected boolean proxySetterUsed
Constructor Detail

EquandaList

public EquandaList()
Method Detail

size

public int size()
Specified by:
size in interface Collection<ELTYPE>
Specified by:
size in interface List<ELTYPE>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<ELTYPE>
Specified by:
isEmpty in interface List<ELTYPE>

contains

public boolean contains(Object obj)
Specified by:
contains in interface Collection<ELTYPE>
Specified by:
contains in interface List<ELTYPE>

iterator

public Iterator<ELTYPE> iterator()
Specified by:
iterator in interface Iterable<ELTYPE>
Specified by:
iterator in interface Collection<ELTYPE>
Specified by:
iterator in interface List<ELTYPE>

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<ELTYPE>
Specified by:
toArray in interface List<ELTYPE>

toArray

public <ELTYPE> ELTYPE[] toArray(ELTYPE[] result)
Specified by:
toArray in interface Collection<ELTYPE>
Specified by:
toArray in interface List<ELTYPE>

add

public boolean add(ELTYPE element)
Specified by:
add in interface Collection<ELTYPE>
Specified by:
add in interface List<ELTYPE>

add

public void add(int index,
                ELTYPE element)
Specified by:
add in interface List<ELTYPE>

addAll

public boolean addAll(Collection<? extends ELTYPE> coll)
Specified by:
addAll in interface Collection<ELTYPE>
Specified by:
addAll in interface List<ELTYPE>

addAll

public boolean addAll(int index,
                      Collection<? extends ELTYPE> c)
Specified by:
addAll in interface List<ELTYPE>

remove

public boolean remove(Object element)
Specified by:
remove in interface Collection<ELTYPE>
Specified by:
remove in interface List<ELTYPE>

remove

public ELTYPE remove(int index)
Specified by:
remove in interface List<ELTYPE>

removeAll

public boolean removeAll(Collection<?> coll)
Specified by:
removeAll in interface Collection<ELTYPE>
Specified by:
removeAll in interface List<ELTYPE>

retainAll

public boolean retainAll(Collection<?> coll)
Specified by:
retainAll in interface Collection<ELTYPE>
Specified by:
retainAll in interface List<ELTYPE>

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<ELTYPE>
Specified by:
containsAll in interface List<ELTYPE>

clear

public void clear()
Specified by:
clear in interface Collection<ELTYPE>
Specified by:
clear in interface List<ELTYPE>

equals

public boolean equals(Object o)
Specified by:
equals in interface Collection<ELTYPE>
Specified by:
equals in interface List<ELTYPE>
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection<ELTYPE>
Specified by:
hashCode in interface List<ELTYPE>
Overrides:
hashCode in class Object

get

public ELTYPE get(int index)
Specified by:
get in interface List<ELTYPE>

set

public ELTYPE set(int index,
                  ELTYPE element)
Specified by:
set in interface List<ELTYPE>

indexOf

public int indexOf(Object elem)
Specified by:
indexOf in interface List<ELTYPE>

lastIndexOf

public int lastIndexOf(Object elem)
Specified by:
lastIndexOf in interface List<ELTYPE>

listIterator

public ListIterator<ELTYPE> listIterator()
Specified by:
listIterator in interface List<ELTYPE>

listIterator

public ListIterator<ELTYPE> listIterator(int index)
Specified by:
listIterator in interface List<ELTYPE>

subList

public List<ELTYPE> subList(int fromIndex,
                            int toIndex)
Specified by:
subList in interface List<ELTYPE>

isModified

public boolean isModified()

proxySetterUsed

public void proxySetterUsed()

reset

public void reset()

getRemoveSet

public Collection<ELTYPE> getRemoveSet()

setRemoveSet

public void setRemoveSet(Collection<ELTYPE> coll)

clone

public EquandaList<ELTYPE> clone()
Overrides:
clone in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007-2009. All Rights Reserved.