|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.spif.util.SetList
A list backed by another pluggable list which contains unique elements which are optionaly lazily sorted. This is very useful in model collections which are also used as MVC models. MVC collections are most usable when they have consistent ordering and list access, while model collections usually require uniqueness.
Uniqueness is achieved by also backing this list by a Set. But note that Set or OrderedSet is not implemented, due to lazyness.
Constructor Summary | |
SetList()
Creates an unsorted setlist backed by the default backing list |
|
SetList(boolean sorted)
Creates a setlist backed by the default backing list |
|
SetList(boolean sorted,
boolean immutablesOnly)
Creates a setlist backed by the default backing list |
Method Summary | |
void |
add(int i,
java.lang.Object o)
|
boolean |
add(java.lang.Object o)
|
boolean |
addAll(java.util.Collection c)
Not supported |
boolean |
addAll(int index,
java.util.Collection c)
Not supported |
void |
clear()
|
boolean |
contains(java.lang.Object o)
|
boolean |
containsAll(java.util.Collection c)
|
boolean |
equals(java.lang.Object o)
|
java.lang.Object |
get(int index)
|
int |
hashCode()
|
int |
indexOf(java.lang.Object o)
|
boolean |
isEmpty()
|
boolean |
isOptimizingList()
Returns whether we are using an optimized list instance |
java.util.Iterator |
iterator()
|
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)
|
boolean |
retainAll(java.util.Collection c)
|
java.lang.Object |
set(int index,
java.lang.Object element)
|
static void |
setBackingList(java.lang.Class listClass)
Sets the default backing list. |
int |
size()
|
java.util.List |
subList(int fromIndex,
int toIndex)
|
java.lang.Object[] |
toArray()
|
java.lang.Object[] |
toArray(java.lang.Object[] a)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SetList()
public SetList(boolean sorted)
sorted
- if true this list will be lazily sortedpublic SetList(boolean sorted, boolean immutablesOnly)
sorted
- if true this list will be lazily sortedimmutablesOnly
- true if this list contains immutable items
(for instance ids).
This may be used for some run-time optimizationsMethod Detail |
public static void setBackingList(java.lang.Class listClass)
public boolean isOptimizingList()
public void add(int i, java.lang.Object o)
add
in interface java.util.List
public boolean add(java.lang.Object o)
add
in interface java.util.List
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.List
public boolean addAll(int index, java.util.Collection c)
addAll
in interface java.util.List
public void clear()
clear
in interface java.util.List
public boolean contains(java.lang.Object o)
contains
in interface java.util.List
public boolean containsAll(java.util.Collection c)
containsAll
in interface java.util.List
public boolean equals(java.lang.Object o)
equals
in interface java.util.List
equals
in class java.lang.Object
public java.lang.Object get(int index)
get
in interface java.util.List
public int hashCode()
hashCode
in interface java.util.List
hashCode
in class java.lang.Object
public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List
public boolean isEmpty()
isEmpty
in interface java.util.List
public java.util.Iterator iterator()
iterator
in interface java.util.List
public int lastIndexOf(java.lang.Object o)
lastIndexOf
in interface java.util.List
public java.util.ListIterator listIterator()
listIterator
in interface java.util.List
public java.util.ListIterator listIterator(int index)
listIterator
in interface java.util.List
public java.lang.Object remove(int index)
remove
in interface java.util.List
public boolean remove(java.lang.Object o)
remove
in interface java.util.List
public boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.List
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.List
public java.lang.Object set(int index, java.lang.Object element)
set
in interface java.util.List
public int size()
size
in interface java.util.List
public java.util.List subList(int fromIndex, int toIndex)
subList
in interface java.util.List
public java.lang.Object[] toArray()
toArray
in interface java.util.List
public java.lang.Object[] toArray(java.lang.Object[] a)
toArray
in interface java.util.List
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |