@Override public Object clone() { long cloneAddr = cloneImpl(this.address); NativeBreakIterator clone = new NativeBreakIterator(cloneAddr, this.type); clone.string = this.string; // The RI doesn't clone the CharacterIterator. clone.charIterator = this.charIterator; return clone; }
/** * Returns a copy of this iterator. */ @Override public Object clone() { try { BreakIterator cloned = (BreakIterator) super.clone(); cloned.wrapped = (NativeBreakIterator) wrapped.clone(); return cloned; } catch (CloneNotSupportedException e) { throw new AssertionError(e); } } }
@Override protected void finalize() throws Throwable { try { closeImpl(this.address); } finally { super.finalize(); } }
public static NativeBreakIterator getCharacterInstance(Locale where) { return new NativeBreakIterator(getCharacterInstanceImpl(where.toString()), BI_CHAR_INSTANCE); }
public static NativeBreakIterator getSentenceInstance(Locale where) { return new NativeBreakIterator(getSentenceInstanceImpl(where.toString()), BI_SENT_INSTANCE); }
public static NativeBreakIterator getWordInstance(Locale where) { return new NativeBreakIterator(getWordInstanceImpl(where.toString()), BI_WORD_INSTANCE); }
public static NativeBreakIterator getLineInstance(Locale where) { return new NativeBreakIterator(getLineInstanceImpl(where.toString()), BI_LINE_INSTANCE); }
public int current() { return currentImpl(this.address, this.string); }
@Override public boolean equals(Object o) { if (!(o instanceof RuleBasedBreakIterator)) { return false; } return wrapped.equals(((RuleBasedBreakIterator) o).wrapped); }
@Override public int following(int offset) { checkOffset(offset); return wrapped.following(offset); }
@Override public int current() { return wrapped.current(); }
public int first() { return firstImpl(this.address, this.string); }
@Override public int first() { return wrapped.first(); }
public static NativeBreakIterator getWordInstance(Locale where) { return new NativeBreakIterator(getWordInstanceImpl(where.toString()), BI_WORD_INSTANCE); }
public static NativeBreakIterator getCharacterInstance(Locale where) { return new NativeBreakIterator(getCharacterInstanceImpl(where.toString()), BI_CHAR_INSTANCE); }
public static NativeBreakIterator getSentenceInstance(Locale where) { return new NativeBreakIterator(getSentenceInstanceImpl(where.toString()), BI_SENT_INSTANCE); }
public static NativeBreakIterator getLineInstance(Locale where) { return new NativeBreakIterator(getLineInstanceImpl(where.toString()), BI_LINE_INSTANCE); }
public CharacterIterator getText() { int newLocation = currentImpl(this.address, this.string); this.charIterator.setIndex(newLocation); return this.charIterator; }
@Override public boolean equals(Object o) { if (!(o instanceof RuleBasedBreakIterator)) { return false; } return wrapped.equals(((RuleBasedBreakIterator) o).wrapped); }
@Override public int following(int offset) { checkOffset(offset); return wrapped.following(offset); }