com.ibm.text
Class CompoundTransliterator

java.lang.Object
  |
  +--com.ibm.text.Transliterator
        |
        +--com.ibm.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.

If a non-null UnicodeFilter is applied to a CompoundTransliterator, it has the effect of being logically anded with the filter of each transliterator in the chain.

Copyright © IBM Corporation 1999. All rights reserved.

Version:
$RCSfile: CompoundTransliterator.java,v $ $Revision: 1.11 $ $Date: 2000/06/28 20:49:54 $
Author:
Alan Liu

Inner classes inherited from class com.ibm.text.Transliterator
Transliterator.Position
 
Fields inherited from class com.ibm.text.Transliterator
FORWARD, REVERSE
 
Constructor Summary
CompoundTransliterator(java.lang.String ID)
           
CompoundTransliterator(java.lang.String ID, int direction)
           
CompoundTransliterator(java.lang.String ID, int direction, UnicodeFilter filter)
          Splits an ID of the form "ID;ID;..." into a compound using each of the IDs.
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.text.Replaceable, com.ibm.text.Transliterator.Position, boolean).
 void setFilter(UnicodeFilter f)
          Override Transliterator.
 
Methods inherited from class com.ibm.text.Transliterator
filteredCharAt, finishTransliteration, getAvailableIDs, getDisplayName, getDisplayName, getFilter, getID, getInstance, getInstance, getInverse, getMaximumContextLength, registerClass, 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)
Splits an ID of the form "ID;ID;..." into a compound using each of the IDs.
Parameters:
ID - of above form
forward - if false, does the list in reverse order, and takes the inverse of each ID.

CompoundTransliterator

public CompoundTransliterator(java.lang.String ID,
                              int direction)

CompoundTransliterator

public CompoundTransliterator(java.lang.String 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

setFilter

public void setFilter(UnicodeFilter f)
Override Transliterator. Modify the transliterators that make up this compound transliterator so their filters are the logical AND of this transliterator's filter and their own. Original filters are kept in the filters array.
Overrides:
setFilter in class Transliterator

handleTransliterate

protected void handleTransliterate(Replaceable text,
                                   Transliterator.Position index,
                                   boolean incremental)
Implements Transliterator.handleTransliterate(com.ibm.text.Replaceable, com.ibm.text.Transliterator.Position, boolean).
Overrides:
handleTransliterate in class Transliterator
Following copied from class: com.ibm.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.text.Replaceable, int, int)


Copyright (c) 1998-2000 IBM Corporation and others.