|
|||||||||||
| 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 sorted
public 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 optimizations| Method 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.Listpublic boolean add(java.lang.Object o)
add in interface java.util.Listpublic 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.Listpublic void clear()
clear in interface java.util.Listpublic boolean contains(java.lang.Object o)
contains in interface java.util.Listpublic boolean containsAll(java.util.Collection c)
containsAll in interface java.util.Listpublic boolean equals(java.lang.Object o)
equals in interface java.util.Listequals in class java.lang.Objectpublic java.lang.Object get(int index)
get in interface java.util.Listpublic int hashCode()
hashCode in interface java.util.ListhashCode in class java.lang.Objectpublic int indexOf(java.lang.Object o)
indexOf in interface java.util.Listpublic boolean isEmpty()
isEmpty in interface java.util.Listpublic java.util.Iterator iterator()
iterator in interface java.util.Listpublic int lastIndexOf(java.lang.Object o)
lastIndexOf in interface java.util.Listpublic java.util.ListIterator listIterator()
listIterator in interface java.util.Listpublic java.util.ListIterator listIterator(int index)
listIterator in interface java.util.Listpublic java.lang.Object remove(int index)
remove in interface java.util.Listpublic boolean remove(java.lang.Object o)
remove in interface java.util.Listpublic boolean removeAll(java.util.Collection c)
removeAll in interface java.util.Listpublic 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.Listpublic int size()
size in interface java.util.List
public java.util.List subList(int fromIndex,
int toIndex)
subList in interface java.util.Listpublic java.lang.Object[] toArray()
toArray in interface java.util.Listpublic 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 | ||||||||||