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

pack-priv Class FunctionReplacer

extends Object
implements UnicodeReplacer
Class Inheritance
All Implemented Interfaces
com.ibm.icu.text.UnicodeReplacer

A replacer that calls a transliterator to generate its output text. The input text to the transliterator is the output of another UnicodeReplacer object. That is, this replacer wraps another replacer with a transliterator.
Author
Alan Liu

Field Summary

Modifier and TypeField and Description
private UnicodeReplacer
replacer

The replacer object.

private Transliterator
translit

The transliterator.

Constructor Summary

AccessConstructor and Description
public
FunctionReplacer(Transliterator theTranslit, UnicodeReplacer theReplacer)

Construct a replacer that takes the output of the given replacer, passes it through the given transliterator, and emits the result as output.

Method Summary

Modifier and TypeMethod and Description
public void
addReplacementSetTo(UnicodeSet
the set into which to union the output characters
toUnionTo
)

Implements com.ibm.icu.text.UnicodeReplacer.addReplacementSetTo.

Union the set of all characters that may output by this object into the given set.
public int
replace(Replaceable
the text to be matched
text
,
int
inclusive start index of text to be replaced
start
,
int
exclusive end index of text to be replaced; must be greater than or equal to start
limit
,
int[]
output parameter for the cursor position. Not all replacer objects will update this, but in a complete tree of replacer objects, representing the entire output side of a transliteration rule, at least one must update it.
cursor
)

Implements com.ibm.icu.text.UnicodeReplacer.replace.

UnicodeReplacer API
public String
toReplacerPattern(boolean
if true then convert unprintable character to their hex escape representations, \\uxxxx or \\Uxxxxxxxx. Unprintable characters are defined by Utility.isUnprintable().
escapeUnprintable
)

Implements com.ibm.icu.text.UnicodeReplacer.toReplacerPattern.

UnicodeReplacer API
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

replacerback to summary
private UnicodeReplacer replacer

The replacer object. This generates text that is then processed by 'translit'. Must not be null.

translitback to summary
private Transliterator translit

The transliterator. Must not be null.

Constructor Detail

FunctionReplacerback to summary
public FunctionReplacer(Transliterator theTranslit, UnicodeReplacer theReplacer)

Construct a replacer that takes the output of the given replacer, passes it through the given transliterator, and emits the result as output.

Method Detail

addReplacementSetToback to summary
public void addReplacementSetTo(UnicodeSet toUnionTo)

Implements com.ibm.icu.text.UnicodeReplacer.addReplacementSetTo.

Union the set of all characters that may output by this object into the given set.

Parameters
toUnionTo:UnicodeSet

the set into which to union the output characters

Annotations
@Override
replaceback to summary
public int replace(Replaceable text, int start, int limit, int[] cursor)

Implements com.ibm.icu.text.UnicodeReplacer.replace.

UnicodeReplacer API

Parameters
text:Replaceable

Doc from com.ibm.icu.text.UnicodeReplacer.replace.

the text to be matched

start:int

Doc from com.ibm.icu.text.UnicodeReplacer.replace.

inclusive start index of text to be replaced

limit:int

Doc from com.ibm.icu.text.UnicodeReplacer.replace.

exclusive end index of text to be replaced; must be greater than or equal to start

cursor:int[]

Doc from com.ibm.icu.text.UnicodeReplacer.replace.

output parameter for the cursor position. Not all replacer objects will update this, but in a complete tree of replacer objects, representing the entire output side of a transliteration rule, at least one must update it.

Returns:int

Doc from com.ibm.icu.text.UnicodeReplacer.replace.

the number of 16-bit code units in the text replacing the characters at offsets start..(limit-1) in text

Annotations
@Override
toReplacerPatternback to summary
public String toReplacerPattern(boolean escapeUnprintable)

Implements com.ibm.icu.text.UnicodeReplacer.toReplacerPattern.

UnicodeReplacer API

Parameters
escapeUnprintable:boolean

Doc from com.ibm.icu.text.UnicodeReplacer.toReplacerPattern.

if true then convert unprintable character to their hex escape representations, \\uxxxx or \\Uxxxxxxxx. Unprintable characters are defined by Utility.isUnprintable().

Annotations
@Override