Package org.apache.lucene.analysis.util
Class CharArrayIterator
java.lang.Object
org.apache.lucene.analysis.util.CharArrayIterator
- All Implemented Interfaces:
Cloneable,CharacterIterator
A CharacterIterator used internally for use with
BreakIterator- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanTrue if this JRE has a buggy BreakIterator implementationFields inherited from interface java.text.CharacterIterator
DONE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()charcurrent()charfirst()intintintgetIndex()intintgetStart()char[]getText()protected abstract charjreBugWorkaround(char ch) charlast()static CharArrayIteratorCreate a new CharArrayIterator that works around JRE bugs in a manner suitable forBreakIterator.getSentenceInstance()static CharArrayIteratorCreate a new CharArrayIterator that works around JRE bugs in a manner suitable forBreakIterator.getWordInstance()charnext()charprevious()charsetIndex(int position) voidsetText(char[] array, int start, int length) Set a new region of text to be examined by this iterator
-
Field Details
-
HAS_BUGGY_BREAKITERATORS
public static final boolean HAS_BUGGY_BREAKITERATORSTrue if this JRE has a buggy BreakIterator implementation
-
-
Constructor Details
-
CharArrayIterator
public CharArrayIterator()
-
-
Method Details
-
getText
public char[] getText() -
getStart
public int getStart() -
getLength
public int getLength() -
setText
public void setText(char[] array, int start, int length) Set a new region of text to be examined by this iterator- Parameters:
array- text buffer to examinestart- offset into bufferlength- maximum length to examine
-
current
public char current()- Specified by:
currentin interfaceCharacterIterator
-
jreBugWorkaround
protected abstract char jreBugWorkaround(char ch) -
first
public char first()- Specified by:
firstin interfaceCharacterIterator
-
getBeginIndex
public int getBeginIndex()- Specified by:
getBeginIndexin interfaceCharacterIterator
-
getEndIndex
public int getEndIndex()- Specified by:
getEndIndexin interfaceCharacterIterator
-
getIndex
public int getIndex()- Specified by:
getIndexin interfaceCharacterIterator
-
last
public char last()- Specified by:
lastin interfaceCharacterIterator
-
next
public char next()- Specified by:
nextin interfaceCharacterIterator
-
previous
public char previous()- Specified by:
previousin interfaceCharacterIterator
-
setIndex
public char setIndex(int position) - Specified by:
setIndexin interfaceCharacterIterator
-
clone
- Specified by:
clonein interfaceCharacterIterator- Overrides:
clonein classObject
-
newSentenceInstance
Create a new CharArrayIterator that works around JRE bugs in a manner suitable forBreakIterator.getSentenceInstance() -
newWordInstance
Create a new CharArrayIterator that works around JRE bugs in a manner suitable forBreakIterator.getWordInstance()
-