|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Set
Implements a Set using a cs111.LinkedList. A Set is an unordered collection of unique objects.
Constructor Summary | |
Set()
Create a new Set, initially empty. |
|
Set(Set s)
Create a new Set with the same elements as in the given set. |
Method Summary | |
void |
addTo(java.lang.Object o)
Add an object to the Set. |
protected java.lang.Object |
clone()
We will make a clone of a Set. |
protected LinkedList |
getList()
Return the LinkedList which holds this Set |
boolean |
isEmpty()
See if the Set is empty. |
boolean |
memberOf(java.lang.Object o)
See if an Object is a member of a Set |
java.lang.String |
toString()
Return a String representation of a Set. |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public Set()
public Set(Set s)
s
- the Set to take the elements fromMethod Detail |
public boolean isEmpty()
public void addTo(java.lang.Object o)
o
- The Object to be added.public boolean memberOf(java.lang.Object o)
o
- is object whose membership is testedpublic java.lang.String toString()
protected LinkedList getList()
protected java.lang.Object clone()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |