com.ibm.icu.text
Class CompoundTransliterator

java.lang.Object
  |
  +--com.ibm.icu.text.Transliterator
        |
        +--com.ibm.icu.text.CompoundTransliterator

public class CompoundTransliterator
extends Transliterator

A transliterator that is composed of two or more other transliterator objects linked together. For example, if one transliterator transliterates from script A to script B, and another transliterates from script B to script C, the two may be combined to form a new transliterator from A to C.

Composed transliterators may not behave as expected. For example, inverses may not combine to form the identity transliterator. See the class documentation for Transliterator for details.

Copyright © IBM Corporation 1999. All rights reserved.

Version:
$RCSfile: CompoundTransliterator.java,v $ $Revision: 1.29 $ $Date: 2002/02/25 22:43:58 $
Author:
Alan Liu

Inner classes inherited from class com.ibm.icu.text.Transliterator
Transliterator.Factory, Transliterator.Position
 
Fields inherited from class com.ibm.icu.text.Transliterator
FORWARD, ID_DELIM, ID_SEP, REVERSE, VARIANT_SEP
 
Constructor Summary
CompoundTransliterator(java.lang.String ID)
          Constructs a new forward compound transliterator with no filter.
CompoundTransliterator(java.lang.String ID, int direction)
          Constructs a new compound transliterator with no filter.
CompoundTransliterator(java.lang.String ID, int direction, UnicodeFilter filter)
          Constructs a new compound transliterator.
CompoundTransliterator(Transliterator[] transliterators)
          Constructs a new compound transliterator given an array of transliterators.
CompoundTransliterator(Transliterator[] transliterators, UnicodeFilter filter)
          Constructs a new compound transliterator given an array of transliterators.
 
Method Summary
 int getCount()
          Returns the number of transliterators in this chain.
 Transliterator getTransliterator(int index)
          Returns the transliterator at the given index in this chain.
protected  void handleTransliterate(Replaceable text, Transliterator.Position index, boolean incremental)
          Implements Transliterator.handleTransliterate(com.ibm.icu.text.Replaceable, com.ibm.icu.text.Transliterator.Position, boolean).
 java.lang.String toRules(boolean escapeUnprintable)
          Deprecated. To be removed after 2002-sep-30.
 
Methods inherited from class com.ibm.icu.text.Transliterator
baseToRules, createFromRules, filteredCharAt, filteredTransliterate, finishTransliteration, getAvailableIDs, getAvailableSources, getAvailableTargets, getAvailableVariants, getDisplayName, getDisplayName, getFilter, getID, getInstance, getInstance, getInverse, getMaximumContextLength, registerClass, registerFactory, setFilter, setID, setMaximumContextLength, transliterate, transliterate, transliterate, transliterate, transliterate, transliterate, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompoundTransliterator

public CompoundTransliterator(Transliterator[] transliterators,
                              UnicodeFilter filter)
Constructs a new compound transliterator given an array of transliterators. The array of transliterators may be of any length, including zero or one, however, useful compound transliterators have at least two components.
Parameters:
transliterators - array of Transliterator objects
filter - the filter. Any character for which filter.contains() returns false will not be altered by this transliterator. If filter is null then no filtering is applied.

CompoundTransliterator

public CompoundTransliterator(Transliterator[] transliterators)
Constructs a new compound transliterator given an array of transliterators. The array of transliterators may be of any length, including zero or one, however, useful compound transliterators have at least two components.
Parameters:
transliterators - array of Transliterator objects

CompoundTransliterator

public CompoundTransliterator(java.lang.String ID,
                              int direction,
                              UnicodeFilter filter)
Constructs a new compound transliterator.
Parameters:
ID - compound ID
direction - either Transliterator.FORWARD or Transliterator.REVERSE
filter - a global filter for this compound transliterator or null

CompoundTransliterator

public CompoundTransliterator(java.lang.String ID,
                              int direction)
Constructs a new compound transliterator with no filter.
Parameters:
ID - compound ID
direction - either Transliterator.FORWARD or Transliterator.REVERSE

CompoundTransliterator

public CompoundTransliterator(java.lang.String ID)
Constructs a new forward compound transliterator with no filter.
Parameters:
ID - compound ID
Method Detail

getCount

public int getCount()
Returns the number of transliterators in this chain.
Returns:
number of transliterators in this chain.

getTransliterator

public Transliterator getTransliterator(int index)
Returns the transliterator at the given index in this chain.
Parameters:
index - index into chain, from 0 to getCount() - 1
Returns:
transliterator at the given index

toRules

public java.lang.String toRules(boolean escapeUnprintable)
Deprecated. To be removed after 2002-sep-30.

Override Transliterator: Create a rule string that can be passed to createFromRules() to recreate this transliterator.
Overrides:
toRules in class Transliterator
Parameters:
escapeUnprintable - if TRUE then convert unprintable character to their hex escape representations, \\uxxxx or \\Uxxxxxxxx. Unprintable characters are those other than U+000A, U+0020..U+007E.
Returns:
the rule string

handleTransliterate

protected void handleTransliterate(Replaceable text,
                                   Transliterator.Position index,
                                   boolean incremental)
Implements Transliterator.handleTransliterate(com.ibm.icu.text.Replaceable, com.ibm.icu.text.Transliterator.Position, boolean).
Overrides:
handleTransliterate in class Transliterator
Following copied from class: com.ibm.icu.text.Transliterator
Parameters:
text - the buffer holding transliterated and untransliterated text
pos - the start and limit of the text, the position of the cursor, and the start and limit of transliteration.
incremental - if true, assume more text may be coming after pos.contextLimit. Otherwise, assume the text is complete.
See Also:
Transliterator.transliterate(com.ibm.icu.text.Replaceable, int, int)


Copyright (c) 2001 IBM Corporation and others.