public final class CollationElementIterator extends Object
String
as defined by the collation rules in an instance of
RuleBasedCollator
. There is no public constructor for
this class. An instance is created by calling the
getCollationElementIterator
method on
RuleBasedCollator
.Modifier and Type | Field and Description |
---|---|
static int |
NULLORDER
This is a constant value that is returned to indicate that the end of
the string was encountered.
|
Modifier and Type | Method and Description |
---|---|
int |
getMaxExpansion(int value)
This method returns the maximum length of any expansion sequence that
ends with the specified collation order value.
|
int |
getOffset()
This method returns the current offset into the
String
that is being iterated over. |
int |
next()
This method returns the collation ordering value of the next character sequence
in the string (it may be an extended character following collation rules).
|
int |
previous()
This method returns the collation ordering value of the previous character
in the string.
|
static int |
primaryOrder(int order)
This method returns the primary order value for the given collation
value.
|
void |
reset()
This method resets the internal position pointer to read from the
beginning of the
String again. |
static short |
secondaryOrder(int order)
This method returns the secondary order value for the given collation
value.
|
void |
setOffset(int offset)
This method sets the iteration index position into the current
String to the specified value. |
void |
setText(CharacterIterator source)
This method sets the
String that it is iterating over
to the String represented by the specified
CharacterIterator . |
void |
setText(String text)
This method sets the
String that it is iterating over
to the specified String . |
static short |
tertiaryOrder(int order)
This method returns the tertiary order value for the given collation
value.
|
public static final int NULLORDER
public int next()
NULLORDER
if the
end of the string was reached.public int previous()
NULLORDER
if the
beginning of the string was reached.public static int primaryOrder(int order)
order
- The collation value returned from next()
or
previous()
.public void reset()
String
again.public static short secondaryOrder(int order)
order
- The collation value returned from next()
or
previous()
.public static short tertiaryOrder(int order)
order
- The collation value returned from next()
or
previous()
.public void setText(String text)
String
that it is iterating over
to the specified String
.text
- The new String
to iterate over.public void setText(CharacterIterator source)
String
that it is iterating over
to the String
represented by the specified
CharacterIterator
.source
- The CharacterIterator
containing the new
String
to iterate over.public int getOffset()
String
that is being iterated over.public void setOffset(int offset)
String
to the specified value. This value must not
be negative and must not be greater than the last index position
in the String
.offset
- The new iteration index position.IllegalArgumentException
- If the new offset is not valid.public int getMaxExpansion(int value)
value
- The collation order value