|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.commons.collections.collection.AbstractCollectionDecorator
org.apache.commons.collections.set.AbstractSetDecorator
org.apache.commons.collections.set.AbstractSerializableSetDecorator
org.codehaus.groovy.grails.web.binding.ListOrderedSet
public class ListOrderedSet
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 |
| Fields inherited from class org.apache.commons.collections.collection.AbstractCollectionDecorator |
|---|
collection |
| 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 | |
|---|---|
void |
add(int index,
java.lang.Object object)
|
boolean |
add(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.List list)
Factory method to create an ordered set using the supplied list to retain order. |
static ListOrderedSet |
decorate(java.util.Set set)
Factory method to create an ordered set. |
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)
|
java.lang.Object |
remove(int index)
|
boolean |
remove(java.lang.Object object)
|
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.AbstractSetDecorator |
|---|
getSet |
| Methods inherited from class org.apache.commons.collections.collection.AbstractCollectionDecorator |
|---|
contains, containsAll, equals, getCollection, hashCode, isEmpty, size |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
contains, containsAll, equals, hashCode, isEmpty, size |
| Methods inherited from interface java.util.Set |
|---|
contains, containsAll, equals, hashCode, isEmpty, size |
| 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
java.lang.IllegalArgumentException - if set is 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
java.lang.IllegalArgumentException - if set or list is null| Method Detail |
|---|
public static ListOrderedSet decorate(java.util.Set set)
set - the set to decorate, must not be null
java.lang.IllegalArgumentException - if set is nullpublic static ListOrderedSet decorate(java.util.List list)
list - the list to decorate, must not be null
java.lang.IllegalArgumentException - if list is nullpublic java.util.List asList()
public void clear()
clear in interface java.util.Collectionclear in interface java.util.Listclear in interface java.util.Setclear in class org.apache.commons.collections.collection.AbstractCollectionDecoratorpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Listiterator in interface java.util.Setiterator in class org.apache.commons.collections.collection.AbstractCollectionDecoratorpublic boolean add(java.lang.Object object)
add in interface java.util.Collectionadd in interface java.util.Listadd in interface java.util.Setadd in class org.apache.commons.collections.collection.AbstractCollectionDecoratorpublic boolean addAll(java.util.Collection coll)
addAll in interface java.util.CollectionaddAll in interface java.util.ListaddAll in interface java.util.SetaddAll in class org.apache.commons.collections.collection.AbstractCollectionDecoratorpublic boolean remove(java.lang.Object object)
remove in interface java.util.Collectionremove in interface java.util.Listremove in interface java.util.Setremove in class org.apache.commons.collections.collection.AbstractCollectionDecoratorpublic boolean removeAll(java.util.Collection coll)
removeAll in interface java.util.CollectionremoveAll in interface java.util.ListremoveAll in interface java.util.SetremoveAll in class org.apache.commons.collections.collection.AbstractCollectionDecoratorpublic boolean retainAll(java.util.Collection coll)
retainAll in interface java.util.CollectionretainAll in interface java.util.ListretainAll in interface java.util.SetretainAll in class org.apache.commons.collections.collection.AbstractCollectionDecoratorpublic java.lang.Object[] toArray()
toArray in interface java.util.CollectiontoArray in interface java.util.ListtoArray in interface java.util.SettoArray in class org.apache.commons.collections.collection.AbstractCollectionDecoratorpublic java.lang.Object[] toArray(java.lang.Object[] a)
toArray in interface java.util.CollectiontoArray in interface java.util.ListtoArray in interface java.util.SettoArray in class org.apache.commons.collections.collection.AbstractCollectionDecoratorpublic java.lang.Object get(int index)
get in interface java.util.Listpublic int indexOf(java.lang.Object object)
indexOf in interface java.util.List
public void add(int index,
java.lang.Object object)
add in interface java.util.List
public boolean addAll(int index,
java.util.Collection coll)
addAll in interface java.util.Listpublic java.lang.Object remove(int index)
remove in interface java.util.Listpublic java.lang.String toString()
toString in class org.apache.commons.collections.collection.AbstractCollectionDecoratorpublic 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.List
public java.lang.Object set(int index,
java.lang.Object element)
set in interface java.util.List
public java.util.List subList(int fromIndex,
int toIndex)
subList in interface java.util.List
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||