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
Modifier and TypeFieldDescriptionstatic final boolean
True if this JRE has a buggy BreakIterator implementationFields inherited from interface java.text.CharacterIterator
DONE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
char
current()
char
first()
int
int
int
getIndex()
int
int
getStart()
char[]
getText()
protected abstract char
jreBugWorkaround
(char ch) char
last()
static CharArrayIterator
Create a new CharArrayIterator that works around JRE bugs in a manner suitable forBreakIterator.getSentenceInstance()
static CharArrayIterator
Create a new CharArrayIterator that works around JRE bugs in a manner suitable forBreakIterator.getWordInstance()
char
next()
char
previous()
char
setIndex
(int position) void
setText
(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:
current
in interfaceCharacterIterator
-
jreBugWorkaround
protected abstract char jreBugWorkaround(char ch) -
first
public char first()- Specified by:
first
in interfaceCharacterIterator
-
getBeginIndex
public int getBeginIndex()- Specified by:
getBeginIndex
in interfaceCharacterIterator
-
getEndIndex
public int getEndIndex()- Specified by:
getEndIndex
in interfaceCharacterIterator
-
getIndex
public int getIndex()- Specified by:
getIndex
in interfaceCharacterIterator
-
last
public char last()- Specified by:
last
in interfaceCharacterIterator
-
next
public char next()- Specified by:
next
in interfaceCharacterIterator
-
previous
public char previous()- Specified by:
previous
in interfaceCharacterIterator
-
setIndex
public char setIndex(int position) - Specified by:
setIndex
in interfaceCharacterIterator
-
clone
- Specified by:
clone
in interfaceCharacterIterator
- Overrides:
clone
in 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()
-