@java.lang.SuppressWarnings({"rawtypes", "unchecked"}) @java.lang.Deprecated 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.
Modifiers | Name | Description |
---|---|---|
protected java.util.List |
setOrder |
Internal list to hold the sequence of objects |
Constructor and description |
---|
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. |
Type | Name and description |
---|---|
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 | Name |
---|---|
class org.apache.commons.collections.set.AbstractSerializableSetDecorator |
org.apache.commons.collections.set.AbstractSerializableSetDecorator#add(java.lang.Object), org.apache.commons.collections.set.AbstractSerializableSetDecorator#remove(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#size(), org.apache.commons.collections.set.AbstractSerializableSetDecorator#toArray([Ljava.lang.Object;), org.apache.commons.collections.set.AbstractSerializableSetDecorator#toArray(), org.apache.commons.collections.set.AbstractSerializableSetDecorator#addAll(java.util.Collection), org.apache.commons.collections.set.AbstractSerializableSetDecorator#iterator(), org.apache.commons.collections.set.AbstractSerializableSetDecorator#containsAll(java.util.Collection), org.apache.commons.collections.set.AbstractSerializableSetDecorator#removeAll(java.util.Collection), org.apache.commons.collections.set.AbstractSerializableSetDecorator#retainAll(java.util.Collection), org.apache.commons.collections.set.AbstractSerializableSetDecorator#wait(long, int), org.apache.commons.collections.set.AbstractSerializableSetDecorator#wait(long), org.apache.commons.collections.set.AbstractSerializableSetDecorator#wait(), org.apache.commons.collections.set.AbstractSerializableSetDecorator#getClass(), org.apache.commons.collections.set.AbstractSerializableSetDecorator#notify(), org.apache.commons.collections.set.AbstractSerializableSetDecorator#notifyAll() |
class org.apache.commons.collections.set.AbstractSetDecorator |
org.apache.commons.collections.set.AbstractSetDecorator#add(java.lang.Object), org.apache.commons.collections.set.AbstractSetDecorator#remove(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#size(), org.apache.commons.collections.set.AbstractSetDecorator#toArray([Ljava.lang.Object;), org.apache.commons.collections.set.AbstractSetDecorator#toArray(), org.apache.commons.collections.set.AbstractSetDecorator#addAll(java.util.Collection), org.apache.commons.collections.set.AbstractSetDecorator#iterator(), org.apache.commons.collections.set.AbstractSetDecorator#containsAll(java.util.Collection), org.apache.commons.collections.set.AbstractSetDecorator#removeAll(java.util.Collection), org.apache.commons.collections.set.AbstractSetDecorator#retainAll(java.util.Collection), org.apache.commons.collections.set.AbstractSetDecorator#wait(long, int), org.apache.commons.collections.set.AbstractSetDecorator#wait(long), org.apache.commons.collections.set.AbstractSetDecorator#wait(), org.apache.commons.collections.set.AbstractSetDecorator#getClass(), org.apache.commons.collections.set.AbstractSetDecorator#notify(), org.apache.commons.collections.set.AbstractSetDecorator#notifyAll() |
Constructs a new empty ListOrderedSet using a HashSet and an ArrayList internally.
Constructor that wraps (not copies).
set
- the set to decorate, must not be nullConstructor that wraps (not copies) the Set and specifies the list to use. The set and list must both be correctly initialised to the same elements.
set
- the set to decorate, must not be nulllist
- the list to decorate, must not be nullGets an unmodifiable view of the order of the Set.
Factory method to create an ordered set. An ArrayList is used to retain order.
set
- the set to decorate, must not be nullFactory method to create an ordered set using the supplied list to retain order. A HashSet is used for the set behaviour.
list
- the list to decorate, must not be nullUses the underlying List's toString so that order is achieved. This means that the decorated Set's toString is not used, so any custom toStrings will be ignored.