@Override public CharacterIterator getText() { return fIterator.getText(); }
@Override public CharacterIterator getText() { return fIterator.getText(); }
public CharacterIterator getText() { return fIterator.getText(); }
@Override public boolean isBoundary(int offset) { if (offset == getText().getBeginIndex()) return true; else return following(offset - 1) == offset; }
public boolean isBoundary(int offset) { if (offset == getText().getBeginIndex()) return true; else return following(offset - 1) == offset; }
@Override public boolean isBoundary(int offset) { if (offset == getText().getBeginIndex()) return true; else return following(offset - 1) == offset; }
public int following(int offset) { // work around too eager IAEs in standard implementation if (offset == getText().getEndIndex()) return DONE; int next= fIterator.following(offset); if (next == DONE) return DONE; // TODO deal with complex script word boundaries // Math.min(offset + run.length, next) does not work // since BreakIterator.getWordInstance considers _ as boundaries // seems to work fine, however Run run= consumeRun(offset); return offset + run.length; }
@Override public int following(int offset) { // work around too eager IAEs in standard implementation if (offset == getText().getEndIndex()) return DONE; int next= fIterator.following(offset); if (next == DONE) return DONE; // TODO deal with complex script word boundaries // Math.min(offset + run.length, next) does not work // since BreakIterator.getWordInstance considers _ as boundaries // seems to work fine, however Run run= consumeRun(offset); return offset + run.length; }
@Override public int following(int offset) { // work around too eager IAEs in standard implementation if (offset == getText().getEndIndex()) return DONE; int next= fIterator.following(offset); if (next == DONE) return DONE; // TODO deal with complex script word boundaries // Math.min(offset + run.length, next) does not work // since BreakIterator.getWordInstance considers _ as boundaries // seems to work fine, however Run run= consumeRun(offset); return offset + run.length; }
@Override public int preceding(int offset) { if (offset == getText().getBeginIndex()) return DONE; if (isBoundary(offset - 1)) return offset - 1; int previous= offset - 1; do { previous= fIterator.preceding(previous); } while (!isBoundary(previous)); int last= DONE; while (previous < offset) { last= previous; previous= following(previous); } return last; }
public int preceding(int offset) { if (offset == getText().getBeginIndex()) return DONE; if (isBoundary(offset - 1)) return offset - 1; int previous= offset - 1; do { previous= fIterator.preceding(previous); } while (!isBoundary(previous)); int last= DONE; while (previous < offset) { last= previous; previous= following(previous); } return last; }
@Override public int preceding(int offset) { if (offset == getText().getBeginIndex()) return DONE; if (isBoundary(offset - 1)) return offset - 1; int previous= offset - 1; do { previous= fIterator.preceding(previous); } while (!isBoundary(previous)); int last= DONE; while (previous < offset) { last= previous; previous= following(previous); } return last; }