Top Description Fields Constructors Methods
com.ibm.icu.lang

pack-priv Class UCharacterNameIterator

extends Object
implements ValueIterator
Class Inheritance
All Implemented Interfaces
com.ibm.icu.util.ValueIterator
Imports
com.ibm.icu.impl.UCharacterName, .UCharacterNameChoice, com.ibm.icu.util.ValueIterator

Class enabling iteration of the codepoints and their names.

Result of each iteration contains a valid codepoint that has valid name.

See UCharacter.getNameIterator() for an example of use.

Author
synwee
Since
release 2.1, March 5 2002

Field Summary

Modifier and TypeField and Description
private static char[]
private static char[]
GROUP_OFFSETS_

Group use

private int
m_algorithmIndex_

Algorithm index

private int
m_choice_

Name choice

private int
m_current_

Current codepoint

private int
m_groupIndex_

Group index

private int
m_limit_

End + 1 iteration range

private UCharacterName
m_name_

Name data

private int
m_start_

Start iteration range

Constructor Summary

AccessConstructor and Description
protected
UCharacterNameIterator(UCharacterName
name data
name
,
int
name choice from the class com.ibm.icu.lang.UCharacterNameChoice
choice
)

Constructor

Method Summary

Modifier and TypeMethod and Description
private boolean

Returns:

false if a codepoint with a name is found and we can bail from further iteration, true to continue on with the iteration (this will always be false for valid codepoints)
iterateExtended
(ValueIterator.Element
stores the result codepoint and name
result
,
int
last codepoint + 1 in range to search
limit
)

Iterate extended names.

private boolean

Returns:

false if a codepoint with a name is found in group and we can bail from further iteration, true to continue on with the iteration
iterateGroup
(ValueIterator.Element
stores the result codepoint and name
result
,
int
last codepoint + 1 in range to search
limit
)

Group name iteration, iterate all the names in the current 32-group and returns the first codepoint that has a valid name.

private boolean

Returns:

false if a codepoint with a name is found in group and we can bail from further iteration, true to continue on with the iteration
iterateSingleGroup
(ValueIterator.Element
stores the result codepoint and name
result
,
int
last codepoint + 1 in range to search
limit
)

Group name iteration, iterate all the names in the current 32-group and returns the first codepoint that has a valid name.

public boolean

Returns:

true if we are not at the end of the iteration, false otherwise.
next
(ValueIterator.Element
for storing the result codepoint and name
element
)

Implements com.ibm.icu.util.ValueIterator.next.

Gets the next result for this iteration and returns true if we are not at the end of the iteration, false otherwise.

public void
reset()

Implements com.ibm.icu.util.ValueIterator.reset.

Resets the iterator to start iterating from the integer index UCharacter.MIN_VALUE or X if a setRange(X, Y) has been called previously.

public void
setRange(int
first integer in range to iterate
start
,
int
1 integer after the last integer in range
limit
)

Implements com.ibm.icu.util.ValueIterator.setRange.

Restricts the range of integers to iterate and resets the iteration to begin at the index argument start.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

GROUP_LENGTHS_back to summary
private static char[] GROUP_LENGTHS_
GROUP_OFFSETS_back to summary
private static char[] GROUP_OFFSETS_

Group use

m_algorithmIndex_back to summary
private int m_algorithmIndex_

Algorithm index

m_choice_back to summary
private int m_choice_

Name choice

m_current_back to summary
private int m_current_

Current codepoint

m_groupIndex_back to summary
private int m_groupIndex_

Group index

m_limit_back to summary
private int m_limit_

End + 1 iteration range

m_name_back to summary
private UCharacterName m_name_

Name data

m_start_back to summary
private int m_start_

Start iteration range

Constructor Detail

UCharacterNameIteratorback to summary
protected UCharacterNameIterator(UCharacterName name, int choice)

Constructor

Parameters
name:UCharacterName

name data

choice:int

name choice from the class com.ibm.icu.lang.UCharacterNameChoice

Method Detail

iterateExtendedback to summary
private boolean iterateExtended(ValueIterator.Element result, int limit)

Iterate extended names.

Parameters
result:ValueIterator.Element

stores the result codepoint and name

limit:int

last codepoint + 1 in range to search

Returns:boolean

false if a codepoint with a name is found and we can bail from further iteration, true to continue on with the iteration (this will always be false for valid codepoints)

iterateGroupback to summary
private boolean iterateGroup(ValueIterator.Element result, int limit)

Group name iteration, iterate all the names in the current 32-group and returns the first codepoint that has a valid name.

Parameters
result:ValueIterator.Element

stores the result codepoint and name

limit:int

last codepoint + 1 in range to search

Returns:boolean

false if a codepoint with a name is found in group and we can bail from further iteration, true to continue on with the iteration

iterateSingleGroupback to summary
private boolean iterateSingleGroup(ValueIterator.Element result, int limit)

Group name iteration, iterate all the names in the current 32-group and returns the first codepoint that has a valid name.

Parameters
result:ValueIterator.Element

stores the result codepoint and name

limit:int

last codepoint + 1 in range to search

Returns:boolean

false if a codepoint with a name is found in group and we can bail from further iteration, true to continue on with the iteration

nextback to summary
public boolean next(ValueIterator.Element element)

Implements com.ibm.icu.util.ValueIterator.next.

Gets the next result for this iteration and returns true if we are not at the end of the iteration, false otherwise.

If the return boolean is a false, the contents of elements will not be updated.

Parameters
element:ValueIterator.Element

for storing the result codepoint and name

Returns:boolean

true if we are not at the end of the iteration, false otherwise.

Annotations
@Override
See Also
com.ibm.icu.util.ValueIterator.Element
resetback to summary
public void reset()

Implements com.ibm.icu.util.ValueIterator.reset.

Resets the iterator to start iterating from the integer index UCharacter.MIN_VALUE or X if a setRange(X, Y) has been called previously.

Annotations
@Override
setRangeback to summary
public void setRange(int start, int limit)

Implements com.ibm.icu.util.ValueIterator.setRange.

Restricts the range of integers to iterate and resets the iteration to begin at the index argument start.

If setRange(start, end) is not performed before next(element) is called, the iteration will start from the integer index UCharacter.MIN_VALUE and end at UCharacter.MAX_VALUE.

If this range is set outside the range of UCharacter.MIN_VALUE and UCharacter.MAX_VALUE, next(element) will always return false.

Parameters
start:int

first integer in range to iterate

limit:int

1 integer after the last integer in range

Annotations
@Override
Exceptions
IllegalArgumentException:
thrown when attempting to set an illegal range. E.g limit <= start