📄 lineariterator.java
字号:
package simple;
/** A basic iterator interface for moving through a collection of items linearly.
It utilizes a cursor to keep track of the current item in the sequence. It
has methods to move to the front of the collection and to move forward. */
public interface LinearIterator
{
/** Is there a current item? */
public boolean itemExists();
/** The current item.
PRECONDITION:
itemExists() */
public Object item() throws NoCurrentItemUosException;
/** Is the current position before the start of the structure? */
public boolean before();
/** Is the current position after the end of the structure? */
public boolean after();
/** Go to the first item in the structure. */
public void goFirst();
/** Advance one item in the data structure.
PRECONDITION:
!after() */
public void goForth() throws AfterTheEndUosException;
/** Move to the position prior to the first element in the structure. */
public void goBefore();
/** Move to the position after the last element in the structure. */
public void goAfter();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -