|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--csc241.samples.stringList.stringLinkedListItr | +--csc241.samples.stringList.stringLinkedListSortedItr
stringLinkedListSortedItr class inherits stringLinkedListItr and ensures that the list is maintained in an ascending order. The insert and addAtBeginning methods must be overridden to ensure the insertions don't violate keeping the order. insert places an element in its appropriate position in the list. addAtBeginning does nothing; all insertions must be done through the insert method.
Fields inherited from class csc241.samples.stringList.stringLinkedListItr |
current_,
myList_ |
Constructor Summary | |
stringLinkedListSortedItr(stringLinkedList anyList)
Invoke the constructor for stringLinkedListItr. |
Method Summary | |
void |
insert(java.lang.String x)
Insert x in its proper location in the list. |
void |
insertAtBeginning(java.lang.String x)
Do nothing! |
Methods inherited from class csc241.samples.stringList.stringLinkedListItr |
advance,
dump,
find,
first,
remove,
retrieve,
validCurrent |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public stringLinkedListSortedItr(stringLinkedList anyList)
anyList
- a LinkedList object to which this iterator is
permanently bound.Method Detail |
public void insert(java.lang.String x)
x
- the item to insert.public void insertAtBeginning(java.lang.String x)
x
- the item to insert.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |