net.java.sen.dictionary
インタフェース SentenceIterator

すべてのスーパーインタフェース:
CharIterator

public interface SentenceIterator
extends CharIterator

An iterator over a sequence of characters, consisting of subsequences that may overlap, and that do not necessarily cover every character in the underlying sequence. The iterator has both a current character position, from which characters are read, and an origin position that the character position may be returned to. Initially, both the origin and current character positions are invalid (as there may be no valid origins present); a call to hasNextOrigin should first be made to determine if an origin is present, followed by a call to nextOrigin() to move to the first available origin.


メソッドの概要
 char current()
          Returns the character at the current character cursor position
 boolean hasNextOrigin()
          Reports whether the sentence has any more origins
 int length()
          Returns the length of the underlying character range being iterated over, including any ignored characters
 int nextOrigin()
          Moves the origin forward to the next available position.
 int origin()
          Returns the current origin position.
 void rewindToOrigin()
          Returns to the current origin position.
 int skippedCharCount()
          Returns the number of characters skipped between the previous and current character spans
 
インタフェース net.java.sen.trie.CharIterator から継承されたメソッド
hasNext, next
 

メソッドの詳細

length

int length()
Returns the length of the underlying character range being iterated over, including any ignored characters

戻り値:
The length of the sentence being iterated over

origin

int origin()
Returns the current origin position. The origin is the position starting from which characters are read. {link returnToOrigin returnToOrigin} moves back to the current origin; {link nextOrigin nextOrigin} moves to the next available origin, if any.

戻り値:
The current origin position

current

char current()
Returns the character at the current character cursor position

戻り値:
The character at the current character cursor position

hasNextOrigin

boolean hasNextOrigin()
Reports whether the sentence has any more origins

戻り値:
true if the sentence has more origins remaining

nextOrigin

int nextOrigin()
Moves the origin forward to the next available position. Subsequent characters returned by next will start at the new origin position

戻り値:
The new origin

rewindToOrigin

void rewindToOrigin()
Returns to the current origin position. Subsequent characters returned by next will start at the origin position


skippedCharCount

int skippedCharCount()
Returns the number of characters skipped between the previous and current character spans

戻り値:
The number of characters skipped


Copyright ? 2008. All Rights Reserved.