Package org.apache.lucene.analysis.util
Class CharArrayIterator
- java.lang.Object
-
- org.apache.lucene.analysis.util.CharArrayIterator
-
- All Implemented Interfaces:
Cloneable
,CharacterIterator
public abstract class CharArrayIterator extends Object implements CharacterIterator
A CharacterIterator used internally for use withBreakIterator
- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
HAS_BUGGY_BREAKITERATORS
True if this JRE has a buggy BreakIterator implementation-
Fields inherited from interface java.text.CharacterIterator
DONE
-
-
Constructor Summary
Constructors Constructor Description CharArrayIterator()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description CharArrayIterator
clone()
char
current()
char
first()
int
getBeginIndex()
int
getEndIndex()
int
getIndex()
int
getLength()
int
getStart()
char[]
getText()
protected abstract char
jreBugWorkaround(char ch)
char
last()
static CharArrayIterator
newSentenceInstance()
Create a new CharArrayIterator that works around JRE bugs in a manner suitable forBreakIterator.getSentenceInstance()
static CharArrayIterator
newWordInstance()
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
-
-
-
Method Detail
-
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
public CharArrayIterator clone()
- Specified by:
clone
in interfaceCharacterIterator
- Overrides:
clone
in classObject
-
newSentenceInstance
public static CharArrayIterator newSentenceInstance()
Create a new CharArrayIterator that works around JRE bugs in a manner suitable forBreakIterator.getSentenceInstance()
-
newWordInstance
public static CharArrayIterator newWordInstance()
Create a new CharArrayIterator that works around JRE bugs in a manner suitable forBreakIterator.getWordInstance()
-
-