|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--csc241.samples.stringList.stringLinkedListItr
stringLinkedListItr class maintains "current position" on a List
Field Summary | |
protected ListNode |
current_
Current position. |
protected stringLinkedList |
myList_
The List. |
Constructor Summary | |
stringLinkedListItr(stringLinkedList anyList)
Construct the list. |
Method Summary | |
void |
advance()
Advance the current_ position to the next node in the list. |
java.lang.String |
dump()
return a string representing the list content |
boolean |
find(java.lang.String x)
Set the current position to the first node containing an item. |
void |
first()
Set the current_ position to the first node in the list. |
void |
insert(java.lang.String x)
Insert after the current position. |
void |
insertAtBeginning(java.lang.String x)
Insert at the beginning of the list. |
void |
remove(java.lang.String x)
Remove the first occurrence of an item. |
java.lang.String |
retrieve()
Return the item stored in the current_ position. |
boolean |
validCurrent()
Test if the current position references a valid list item. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected stringLinkedList myList_
protected ListNode current_
Constructor Detail |
public stringLinkedListItr(stringLinkedList anyList)
anyList
- a LinkedList object to which this iterator is
permanently bound.Method Detail |
public void insert(java.lang.String x) throws java.lang.Exception
x
- the item to insert.public void insertAtBeginning(java.lang.String x)
x
- the item to insert.public boolean find(java.lang.String x)
x
- the item to search for.public void remove(java.lang.String x) throws java.lang.Exception
x
- the item to remove.public boolean validCurrent()
public java.lang.String retrieve()
public void first()
public void advance()
public java.lang.String dump()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |