|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.rice.cs.drjava.model.definitions.reducedmodel.ModelList.Iterator
Iterators for model list. The iterators are intimately coupled with the ModelList to which they belong. They are the only public interface for manipulating ModelList. The iterators are also fail-safe with regards to manipulation of the same list, although probably not thread-safe.
Field Summary | |
private ModelList.Node |
_point
|
private int |
_pos
|
Constructor Summary | |
ModelList.Iterator()
Constructor. |
|
ModelList.Iterator(ModelList.Iterator iter)
Copy constructor. |
Method Summary | |
boolean |
atEnd()
Return true if we're pointing at the tail. |
boolean |
atFirstItem()
Return true if we're pointing at the node after the head. |
boolean |
atLastItem()
Return true if we're pointing at the node before the tail. |
boolean |
atStart()
Return true if we're pointing at the head. |
void |
collapse(ModelList.Iterator iter)
Delete all nodes between the current position of this and the current position of the given iterator. |
ModelList.Iterator |
copy()
|
Object |
current()
Return the item associated with the current node. |
void |
dispose()
Disposes of an iterator by removing it from the list's set of listeners. |
boolean |
eq(Object thing)
an equals test |
void |
insert(Object item)
Insert an item before the current item. |
void |
next()
Move to the next node. |
Object |
nextItem()
Return the item associated with the node after the current node. |
private void |
notifyOfCollapse(int leftPos,
int rightPos,
ModelList.Node rightPoint)
When an iterator collapses part of the list, it notifies other iterators in the set of listeners so they can stay updated. |
private void |
notifyOfInsert(int pos)
When an iterator inserts an item, it notifies other iterators in the set of listeners so they can stay updated. |
private void |
notifyOfRemove(int pos,
ModelList.Node point)
When an iterator removes an item, it notifies other iterators in the set of listeners so they can stay updated. |
void |
prev()
Move to the previous node. |
Object |
prevItem()
Return the item associated with the node before the current node. |
void |
remove()
Remove the current item from the list. |
void |
setTo(ModelList.Iterator it)
Force this iterator to take the values of the given iterator. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private ModelList.Node _point
private int _pos
Constructor Detail |
public ModelList.Iterator()
public ModelList.Iterator(ModelList.Iterator iter)
Method Detail |
public ModelList.Iterator copy()
public boolean eq(Object thing)
public void setTo(ModelList.Iterator it)
public void dispose()
public boolean atStart()
public boolean atEnd()
public boolean atFirstItem()
public boolean atLastItem()
public Object current()
public Object prevItem()
public Object nextItem()
public void insert(Object item)
public void remove()
public void prev()
public void next()
public void collapse(ModelList.Iterator iter)
private void notifyOfInsert(int pos)
private void notifyOfRemove(int pos, ModelList.Node point)
private void notifyOfCollapse(int leftPos, int rightPos, ModelList.Node rightPoint)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |