|
||||||||||
| PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractSet
org.jboss.util.collection.ListSet
A thin wrapper around a List transforming it into a
modifiable Set.
| Field Summary | |
protected java.util.List |
list
The List which will be used for element storage. |
| Constructor Summary | |
ListSet()
Construct a ListSet using an ArrayList for backing. |
|
ListSet(java.util.Collection elements)
Construct a ListSet using an ArrayList for backing and populated with the given elements. |
|
ListSet(java.util.List list)
Construct a ListSet. |
|
| Method Summary | |
boolean |
add(java.lang.Object obj)
Add an element to the set. |
void |
clear()
Removes all of the elements from this set. |
java.lang.Object |
clone()
Returns a shallow copy of this ListSet instance. |
boolean |
contains(java.lang.Object obj)
Returns true if this set contains the specified element. |
java.util.List |
getList()
|
boolean |
isEmpty()
Returns true if this set contains no elements. |
java.util.Iterator |
iterator()
Return an iteration over the elements in the set. |
boolean |
remove(java.lang.Object obj)
Removes the given element from this set if it is present. |
int |
size()
Return the size of the set. |
| Methods inherited from class java.util.AbstractSet |
equals, hashCode, removeAll |
| Methods inherited from class java.util.AbstractCollection |
addAll, containsAll, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray |
| Field Detail |
protected final java.util.List list
| Constructor Detail |
public ListSet(java.util.List list)
list - The List which will be used for element storage.
java.lang.IllegalArgumentException - List is null or contains
duplicate entries.public ListSet()
public ListSet(java.util.Collection elements)
elements - The elements for the list.| Method Detail |
public java.util.List getList()
public int size()
size in interface java.util.Setpublic java.util.Iterator iterator()
iterator in interface java.util.Setpublic boolean add(java.lang.Object obj)
add in interface java.util.Setobj - Element to add to the set.
public boolean isEmpty()
isEmpty in interface java.util.Setpublic boolean contains(java.lang.Object obj)
contains in interface java.util.Setobj - Element whose presence in this set is to be tested.
public boolean remove(java.lang.Object obj)
remove in interface java.util.Setobj - Object to be removed from this set, if present.
public void clear()
clear in interface java.util.Setpublic java.lang.Object clone()
|
||||||||||
| PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||