|
||||||||
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.
Field Summary | |
---|---|
protected List |
data
The underlying structure --- a list. |
Constructor Summary | |
---|---|
SetList()
Construct a new set list. |
Method Summary | |
---|---|
void |
add(java.lang.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. |
java.lang.Object |
clone()
Returns a shallow clone of this set. |
boolean |
contains(java.lang.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. |
java.util.Iterator |
iterator()
Construct an traversal to traverse the elements of the set. |
java.lang.Object |
remove(java.lang.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. |
java.lang.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, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface structure.Structure |
---|
elements, values |
Field Detail |
---|
protected List data
Constructor Detail |
---|
public SetList()
Method Detail |
---|
public void clear()
public boolean isEmpty()
isEmpty
in interface Structure
isEmpty
in class AbstractStructure
public void add(java.lang.Object e)
e
- The new value to be added to set.public java.lang.Object remove(java.lang.Object e)
e
- The element of the set to be removed.
public boolean contains(java.lang.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 java.lang.Object clone()
clone
in class java.lang.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 java.util.Iterator iterator()
AbstractIterator
,
Iterator
,
Enumeration
,
Structure.elements()
public int size()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |