|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet
org.jboss.util.collection.ListSet
public class ListSet
A thin wrapper around a List transforming it into a
modifiable Set.
| Field Summary | |
|---|---|
protected List |
list
The List which will be used for element storage. |
| Constructor Summary | |
|---|---|
ListSet()
Construct a ListSet using an ArrayList for backing. |
|
ListSet(Collection elements)
Construct a ListSet using an ArrayList for backing and populated with the given elements. |
|
ListSet(List list)
Construct a ListSet. |
|
| Method Summary | |
|---|---|
boolean |
add(Object obj)
Add an element to the set. |
void |
clear()
Removes all of the elements from this set. |
Object |
clone()
Returns a shallow copy of this ListSet instance. |
boolean |
contains(Object obj)
Returns true if this set contains the specified element. |
List |
getList()
|
boolean |
isEmpty()
Returns true if this set contains no elements. |
Iterator |
iterator()
Return an iteration over the elements in the set. |
boolean |
remove(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 List list
| Constructor Detail |
|---|
public ListSet(List list)
list - The List which will be used for element storage.
IllegalArgumentException - List is null or contains
duplicate entries.public ListSet()
public ListSet(Collection elements)
elements - The elements for the list.| Method Detail |
|---|
public List getList()
public int size()
size in interface Collectionsize in interface Setsize in class AbstractCollectionpublic Iterator iterator()
iterator in interface Iterableiterator in interface Collectioniterator in interface Setiterator in class AbstractCollectionpublic boolean add(Object obj)
add in interface Collectionadd in interface Setadd in class AbstractCollectionobj - Element to add to the set.
public boolean isEmpty()
isEmpty in interface CollectionisEmpty in interface SetisEmpty in class AbstractCollectionpublic boolean contains(Object obj)
contains in interface Collectioncontains in interface Setcontains in class AbstractCollectionobj - Element whose presence in this set is to be tested.
public boolean remove(Object obj)
remove in interface Collectionremove in interface Setremove in class AbstractCollectionobj - Object to be removed from this set, if present.
public void clear()
clear in interface Collectionclear in interface Setclear in class AbstractCollectionpublic Object clone()
clone in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||