Method Next
Next(Int32)
Returns the nth boundary from the current boundary. If either the first or last text boundary has been reached, it returns DONE and the current position is set to either the first or last text boundary depending on which one is reached. Otherwise, the iterator's current position is set to the new boundary. For example, if the iterator's current position is the mth text boundary and three more boundaries exist from the current boundary to the last text boundary, the Next(2) call will return m + 2. The new text position is set to the (m + 2)th text boundary. A Next(4) call would return DONE and the last text boundary would become the new text position.
Declaration
public abstract int Next(int n)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | n | which boundary to return. A value of 0 does nothing. Negative values move to previous boundaries and positive values move to later boundaries. |
Returns
Type | Description |
---|---|
System.Int32 | The character index of the nth boundary from the current position or DONE if either first or last text boundary has been reached. |
Next()
Returns the boundary following the current boundary. If the current boundary
is the last text boundary, it returns BreakIterator.DONE
and
the iterator's current position is unchanged. Otherwise, the iterator's
current position is set to the boundary following the current boundary.
Declaration
public abstract int Next()
Returns
Type | Description |
---|---|
System.Int32 | The character index of the next text boundary or DONE if the current boundary is the last text boundary. Equivalent to Next(1). |