|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jds.collection.SortedList
SortedList - a linked list that is maintained in order; for use with book Classic Data Structures in Java by Timothy A Budd, published by Addison-Wesley, 2001.
Collection
, Serialized FormConstructor Summary | |
SortedList(java.util.Comparator c)
initialize a sorted list |
Method Summary | |
void |
addElement(java.lang.Object newElement)
add a new value to the collection |
boolean |
containsElement(java.lang.Object val)
see if collection contains value |
void |
differenceWith(Bag newSet)
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 |
java.lang.Object |
getFirst()
yields the smallest element in collection |
void |
intersectWith(Bag newSet)
form intersection with argument set |
boolean |
isEmpty()
Determines whether the collection is empty |
void |
mergeWith(Collection newSet)
|
void |
removeElement(java.lang.Object val)
remove a new value from the collection |
void |
removeFirst()
removes the smallest element in collection |
int |
size()
Determines number of elements in collection |
boolean |
subsetOf(Bag newSet)
see if current set is subset of argument set |
void |
unionWith(Bag newSet)
form union with argument set |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public SortedList(java.util.Comparator c)
c
- the comparator objectMethod Detail |
public java.util.Enumeration elements()
Enumeration
that will yield the elements of the collectionEnumeration
public boolean isEmpty()
public int size()
public void addElement(java.lang.Object newElement)
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 java.lang.Object getFirst()
public void removeFirst()
public void mergeWith(Collection newSet)
public void unionWith(Bag newSet)
aSet
- collection to be joined to currentpublic void intersectWith(Bag newSet)
aSet
- collection to be intersected with currentpublic void differenceWith(Bag newSet)
aSet
- collection to be compared to currentpublic boolean subsetOf(Bag newSet)
aSet
- collection to be tested against
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |