|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--moses.controlState.CSIterator
This object is an iterator that allows iterations through all the terms of a list type or compound term (control state included). More general, it allows iteration through all the sub terms of a composed or list type term. It provides a (specialized) subset of a ListIterator interface methods, allowing direct access to the Term type sub terms. Implementation wise, it uses Vector.listIterator methods in an unsynchronized manner. This object should not be used in a multi-threaded context: While the iterator is being used, the source object (i.e. ControlState, list or composed term ) should only be modified through iterator's own methods, otherwise unpredictable behavior can happen.
| Constructor Summary | |
CSIterator(moses.controlState.ControlState cs)
This constructor creates an iterator from a ControlState object. This method is only used by the internal implementation, is not intended to be used by a user programmer. |
|
CSIterator(moses.controlState.Term list)
This constructor creates an iterator from a Term object. |
|
| Method Summary | |
void |
add(moses.controlState.Term t)
Inserts the term t into the list, at the current iterating position, before the term that is to be returned by the next() method (see more at ListIterator). This method is only used by the internal implementation, is not intended to be used by a user programmer. |
boolean |
hasNext()
This method returns true if there are more elements to perform in this iterator. |
moses.controlState.Term |
next()
This method returns the next element to perform in this iterator. |
void |
remove()
Removes from the list the last element that was returned by next() method (see more at ListIterator). |
void |
set(moses.controlState.Term t)
Replaces the last element that was returned by next() method with the argument element (see more at ListIterator). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CSIterator(moses.controlState.ControlState cs)
public CSIterator(moses.controlState.Term list)
list - represents the term object to be iterated through.| Method Detail |
public void add(moses.controlState.Term t)
t - represents the term to be appended to the iterator object.public boolean hasNext()
public moses.controlState.Term next()
public void remove()
public void set(moses.controlState.Term t)
t - represents the new element to replace the current iteration item.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||