|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object structure.AbstractStructure structure.AbstractSet structure.SetList
public class SetList
An implementation of a set using lists.
Constructor Summary | |
---|---|
SetList()
Construct a new set list. |
Method Summary | |
---|---|
void |
add(Object e)
Add an element to set, if not already present. |
void |
addAll(Structure other)
Compute the union of this set with other. |
void |
clear()
Remove all the elements from the set. |
Object |
clone()
Returns a shallow clone of this set. |
boolean |
contains(Object e)
Returns true if value is an element of the set. |
boolean |
containsAll(Structure other)
Determine if this set is a subset of other. |
boolean |
isEmpty()
Determine if the set is empty. |
Iterator |
iterator()
Construct an traversal to traverse the elements of the set. |
Object |
remove(Object e)
Remove an element from the set. |
void |
removeAll(Structure other)
Compute the difference between two sets. |
void |
retainAll(Structure other)
Compute the intersection of this set and other. |
int |
size()
Determine the number of elements in the set. |
String |
toString()
Construct a string representation of the set. |
Methods inherited from class structure.AbstractStructure |
---|
elements, hashCode, values |
Methods inherited from class java.lang.Object |
---|
equals, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface structure.Structure |
---|
elements, values |
Constructor Detail |
---|
public SetList()
Method Detail |
---|
public void clear()
public boolean isEmpty()
isEmpty
in interface Structure
isEmpty
in class AbstractStructure
public void add(Object e)
e
- The new value to be added to set.public Object remove(Object e)
e
- The element of the set to be removed.
public boolean contains(Object e)
contains
in interface Structure
contains
in class AbstractStructure
e
- The element sought in set.
public boolean containsAll(Structure other)
containsAll
in interface Set
containsAll
in class AbstractSet
other
- The potential superset.public Object clone()
clone
in class Object
public void addAll(Structure other)
addAll
in interface Set
addAll
in class AbstractSet
other
- The set to be unioned with this.public void retainAll(Structure other)
retainAll
in interface Set
retainAll
in class AbstractSet
other
- The other set to be intersected with this.public void removeAll(Structure other)
removeAll
in interface Set
removeAll
in class AbstractSet
other
- The set whose values are to be eliminated from this.public Iterator iterator()
AbstractIterator
,
Iterator
,
Enumeration
,
Structure.elements()
public int size()
public String toString()
toString
in class Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |