org.eclipse.xtext.ui.editor.model
Class CommonBreakIterator.Run

java.lang.Object
  extended by org.eclipse.xtext.ui.editor.model.CommonBreakIterator.Run
Direct Known Subclasses:
CommonBreakIterator.CamelCaseIdentifier, CommonBreakIterator.Identifier, CommonBreakIterator.LineDelimiter, CommonBreakIterator.Other, CommonBreakIterator.Whitespace
Enclosing class:
CommonBreakIterator

protected abstract static class CommonBreakIterator.Run
extends java.lang.Object

A run of common characters.


Field Summary
protected  int length
          The length of this run.
 
Constructor Summary
CommonBreakIterator.Run()
           
 
Method Summary
protected  boolean consume(char ch)
          Returns true if this run consumes ch, false otherwise.
protected  void init()
          Resets this run to the initial state.
protected abstract  boolean isValid(char ch)
          Whether this run accepts that character; does not update state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

length

protected int length
The length of this run.

Constructor Detail

CommonBreakIterator.Run

public CommonBreakIterator.Run()
Method Detail

consume

protected boolean consume(char ch)
Returns true if this run consumes ch, false otherwise. If true is returned, the length of the receiver is adjusted accordingly.

Parameters:
ch - the character to test
Returns:
true if ch was consumed

isValid

protected abstract boolean isValid(char ch)
Whether this run accepts that character; does not update state. Called from the default implementation of consume.

Parameters:
ch - the character to test
Returns:
true if ch is accepted

init

protected void init()
Resets this run to the initial state.