|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.collections.collection.AbstractCollectionDecorator org.apache.commons.collections.set.AbstractSetDecorator org.apache.commons.collections.set.AbstractSerializableSetDecorator org.codehaus.groovy.grails.web.binding.ListOrderedSet
@SuppressWarnings({"rawtypes", "unchecked"}) public class ListOrderedSet extends org.apache.commons.collections.set.AbstractSerializableSetDecorator
Forked from Apache Commons Collections' implementation of ListOrderedSet. This one actually implements the List interface. Yes we are away of the warnings in the javadoc about problems with incompatibilities between the List and Set interfaces, however this class is designed to used internally only for data binding and not by end users.
Field Summary | |
---|---|
protected java.util.List |
setOrder
Internal list to hold the sequence of objects |
Constructor Summary | |
ListOrderedSet()
Constructs a new empty ListOrderedSet using a HashSet and an ArrayList internally. |
|
protected ListOrderedSet(java.util.Set set)
Constructor that wraps (not copies). |
|
protected ListOrderedSet(java.util.Set set, java.util.List list)
Constructor that wraps (not copies) the Set and specifies the list to use. |
Method Summary | |
---|---|
boolean
|
add(java.lang.Object object)
|
void
|
add(int index, java.lang.Object object)
|
boolean
|
addAll(java.util.Collection coll)
|
boolean
|
addAll(int index, java.util.Collection coll)
|
java.util.List
|
asList()
Gets an unmodifiable view of the order of the Set. |
void
|
clear()
|
static ListOrderedSet
|
decorate(java.util.Set set)
Factory method to create an ordered set. |
static ListOrderedSet
|
decorate(java.util.List list)
Factory method to create an ordered set using the supplied list to retain order. |
java.lang.Object
|
get(int index)
|
int
|
indexOf(java.lang.Object object)
|
java.util.Iterator
|
iterator()
|
int
|
lastIndexOf(java.lang.Object o)
|
java.util.ListIterator
|
listIterator()
|
java.util.ListIterator
|
listIterator(int index)
|
boolean
|
remove(java.lang.Object object)
|
java.lang.Object
|
remove(int index)
|
boolean
|
removeAll(java.util.Collection coll)
|
boolean
|
retainAll(java.util.Collection coll)
|
java.lang.Object
|
set(int index, java.lang.Object element)
|
java.util.List
|
subList(int fromIndex, int toIndex)
|
java.lang.Object[]
|
toArray()
|
java.lang.Object[]
|
toArray(java.lang.Object[] a)
|
java.lang.String
|
toString()
Uses the underlying List's toString so that order is achieved. |
Methods inherited from class org.apache.commons.collections.set.AbstractSerializableSetDecorator | |
---|---|
org.apache.commons.collections.set.AbstractSerializableSetDecorator#add(java.lang.Object), org.apache.commons.collections.set.AbstractSerializableSetDecorator#equals(java.lang.Object), org.apache.commons.collections.set.AbstractSerializableSetDecorator#toString(), org.apache.commons.collections.set.AbstractSerializableSetDecorator#hashCode(), org.apache.commons.collections.set.AbstractSerializableSetDecorator#clear(), org.apache.commons.collections.set.AbstractSerializableSetDecorator#isEmpty(), org.apache.commons.collections.set.AbstractSerializableSetDecorator#contains(java.lang.Object), org.apache.commons.collections.set.AbstractSerializableSetDecorator#addAll(java.util.Collection), org.apache.commons.collections.set.AbstractSerializableSetDecorator#size(), org.apache.commons.collections.set.AbstractSerializableSetDecorator#toArray([Ljava.lang.Object;), org.apache.commons.collections.set.AbstractSerializableSetDecorator#toArray(), org.apache.commons.collections.set.AbstractSerializableSetDecorator#iterator(), org.apache.commons.collections.set.AbstractSerializableSetDecorator#remove(java.lang.Object), org.apache.commons.collections.set.AbstractSerializableSetDecorator#removeAll(java.util.Collection), org.apache.commons.collections.set.AbstractSerializableSetDecorator#containsAll(java.util.Collection), org.apache.commons.collections.set.AbstractSerializableSetDecorator#retainAll(java.util.Collection), org.apache.commons.collections.set.AbstractSerializableSetDecorator#wait(), org.apache.commons.collections.set.AbstractSerializableSetDecorator#wait(long), org.apache.commons.collections.set.AbstractSerializableSetDecorator#wait(long, int), org.apache.commons.collections.set.AbstractSerializableSetDecorator#getClass(), org.apache.commons.collections.set.AbstractSerializableSetDecorator#notify(), org.apache.commons.collections.set.AbstractSerializableSetDecorator#notifyAll() |
Methods inherited from class org.apache.commons.collections.set.AbstractSetDecorator | |
---|---|
org.apache.commons.collections.set.AbstractSetDecorator#add(java.lang.Object), org.apache.commons.collections.set.AbstractSetDecorator#equals(java.lang.Object), org.apache.commons.collections.set.AbstractSetDecorator#toString(), org.apache.commons.collections.set.AbstractSetDecorator#hashCode(), org.apache.commons.collections.set.AbstractSetDecorator#clear(), org.apache.commons.collections.set.AbstractSetDecorator#isEmpty(), org.apache.commons.collections.set.AbstractSetDecorator#contains(java.lang.Object), org.apache.commons.collections.set.AbstractSetDecorator#addAll(java.util.Collection), org.apache.commons.collections.set.AbstractSetDecorator#size(), org.apache.commons.collections.set.AbstractSetDecorator#toArray([Ljava.lang.Object;), org.apache.commons.collections.set.AbstractSetDecorator#toArray(), org.apache.commons.collections.set.AbstractSetDecorator#iterator(), org.apache.commons.collections.set.AbstractSetDecorator#remove(java.lang.Object), org.apache.commons.collections.set.AbstractSetDecorator#removeAll(java.util.Collection), org.apache.commons.collections.set.AbstractSetDecorator#containsAll(java.util.Collection), org.apache.commons.collections.set.AbstractSetDecorator#retainAll(java.util.Collection), org.apache.commons.collections.set.AbstractSetDecorator#wait(), org.apache.commons.collections.set.AbstractSetDecorator#wait(long), org.apache.commons.collections.set.AbstractSetDecorator#wait(long, int), org.apache.commons.collections.set.AbstractSetDecorator#getClass(), org.apache.commons.collections.set.AbstractSetDecorator#notify(), org.apache.commons.collections.set.AbstractSetDecorator#notifyAll() |
Field Detail |
---|
protected final java.util.List setOrder
Constructor Detail |
---|
public ListOrderedSet()
protected ListOrderedSet(java.util.Set set)
set
- the set to decorate, must not be null
protected ListOrderedSet(java.util.Set set, java.util.List list)
set
- the set to decorate, must not be nulllist
- the list to decorate, must not be null
Method Detail |
---|
@Override public boolean add(java.lang.Object object)
public void add(int index, java.lang.Object object)
@Override public boolean addAll(java.util.Collection coll)
public boolean addAll(int index, java.util.Collection coll)
public java.util.List asList()
@Override public void clear()
public static ListOrderedSet decorate(java.util.Set set)
set
- the set to decorate, must not be null
public static ListOrderedSet decorate(java.util.List list)
list
- the list to decorate, must not be null
public java.lang.Object get(int index)
public int indexOf(java.lang.Object object)
@Override public java.util.Iterator iterator()
public int lastIndexOf(java.lang.Object o)
public java.util.ListIterator listIterator()
public java.util.ListIterator listIterator(int index)
@Override public boolean remove(java.lang.Object object)
public java.lang.Object remove(int index)
@Override public boolean removeAll(java.util.Collection coll)
@Override public boolean retainAll(java.util.Collection coll)
public java.lang.Object set(int index, java.lang.Object element)
public java.util.List subList(int fromIndex, int toIndex)
@Override public java.lang.Object[] toArray()
@Override public java.lang.Object[] toArray(java.lang.Object[] a)
@Override public java.lang.String toString()
Groovy Documentation