|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jds.collection.SetAdapter
SetAdapter set formed as a wrapper around existing collection; for use with book Classic Data Structures in Java by Timothy A Budd, published by Addison-Wesley, 2001.
Enumeration
,
Serializable
, Serialized FormConstructor Summary | |
SetAdapter(Bag s)
initialize set adapter by wrapping around an existing set |
Method Summary | |
void |
addElement(java.lang.Object val)
add a new value to the collection |
boolean |
containsElement(java.lang.Object val)
see if collection contains value |
void |
differenceWith(Bag aSet)
form difference from argument set |
java.util.Enumeration |
elements()
Yields enumerator for collection |
java.lang.Object |
findElement(java.lang.Object val)
find element that will test equal to value |
void |
intersectWith(Bag aSet)
form intersection with argument set |
boolean |
isEmpty()
Determines whether the collection is empty |
void |
removeElement(java.lang.Object val)
remove a new value from the collection |
int |
size()
Determines number of elements in collection |
boolean |
subsetOf(Bag aSet)
see if current set is subset of argument set |
void |
unionWith(Bag aSet)
form union with argument set |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public SetAdapter(Bag s)
s
- existing set to hold underlying data valuesMethod Detail |
public boolean isEmpty()
public int size()
public java.util.Enumeration elements()
Enumeration
that will yield the elements of the collectionEnumeration
public void addElement(java.lang.Object val)
value
- element to be inserted into collectionpublic boolean containsElement(java.lang.Object val)
value
- element to be testedpublic java.lang.Object findElement(java.lang.Object val)
value
- element to be testedequals
to argumentpublic void removeElement(java.lang.Object val)
value
- element to be removed from collectionpublic void unionWith(Bag aSet)
aSet
- collection to be joined to currentpublic void intersectWith(Bag aSet)
aSet
- collection to be intersected with currentpublic void differenceWith(Bag aSet)
aSet
- collection to be compared to currentpublic boolean subsetOf(Bag aSet)
aSet
- collection to be tested against
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |