Package com.ibm.icu.text
Class NullTransliterator
java.lang.Object
com.ibm.icu.text.Transliterator
com.ibm.icu.text.NullTransliterator
- All Implemented Interfaces:
StringTransform,Transform<String,String>
A transliterator that leaves text unchanged.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.ibm.icu.text.Transliterator
Transliterator.Factory, Transliterator.Position -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final String(package private) static final StringPackage accessible IDs for this transliterator.Fields inherited from class com.ibm.icu.text.Transliterator
DEBUG, FORWARD, ID_DELIM, ID_SEP, REVERSE, VARIANT_SEP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSourceTargetSet(UnicodeSet inputFilter, UnicodeSet sourceSet, UnicodeSet targetSet) Returns the set of all characters that may be generated as replacement text by this transliterator, filtered by BOTH the input filter, and the current getFilter().protected voidhandleTransliterate(Replaceable text, Transliterator.Position offsets, boolean incremental) Methods inherited from class com.ibm.icu.text.Transliterator
baseToRules, createFromRules, filteredTransliterate, finishTransliteration, getAvailableIDs, getAvailableSources, getAvailableTargets, getAvailableVariants, getBasicInstance, getDisplayName, getDisplayName, getDisplayName, getElements, getFilter, getFilterAsUnicodeSet, getID, getInstance, getInstance, getInverse, getMaximumContextLength, getSourceSet, getTargetSet, handleGetSourceSet, registerAlias, registerAny, registerClass, registerFactory, registerInstance, registerInstance, registerSpecialInverse, setFilter, setID, setMaximumContextLength, toRules, transform, transliterate, transliterate, transliterate, transliterate, transliterate, transliterate, unregister
-
Field Details
-
SHORT_ID
Package accessible IDs for this transliterator.- See Also:
-
_ID
- See Also:
-
-
Constructor Details
-
NullTransliterator
public NullTransliterator()Constructs a transliterator.
-
-
Method Details
-
handleTransliterate
protected void handleTransliterate(Replaceable text, Transliterator.Position offsets, boolean incremental) - Specified by:
handleTransliteratein classTransliterator- Parameters:
text- the buffer holding transliterated and untransliterated textoffsets- the indices indicating the start, limit, context start, and context limit of the text.incremental- if true, assume more text may be inserted atpos.limitand act accordingly. Otherwise, transliterate all text betweenpos.startandpos.limitand movepos.startup topos.limit.- See Also:
-
addSourceTargetSet
Description copied from class:TransliteratorReturns the set of all characters that may be generated as replacement text by this transliterator, filtered by BOTH the input filter, and the current getFilter().SHOULD BE OVERRIDDEN BY SUBCLASSES. It is probably an error for any transliterator to NOT override this, but we can't force them to for backwards compatibility.
Other methods vector through this.
When gathering the information on source and target, the compound transliterator makes things complicated. For example, suppose we have:
Global FILTER = [ax] a > b; :: NULL; b > c; x > d;
While the filter just allows a and x, b is an intermediate result, which could produce c. So the source and target sets cannot be gathered independently. What we have to do is filter the sources for the first transliterator according to the global filter, intersect that transliterator's filter. Based on that we get the target. The next transliterator gets as a global filter (global + last target). And so on.There is another complication:
Global FILTER = [ax] a >|b; b >c;
Even though b would be filtered from the input, whenever we have a backup, it could be part of the input. So ideally we will change the global filter as we go.- Overrides:
addSourceTargetSetin classTransliterator- Parameters:
targetSet- TODO- See Also:
-