Package com.ibm.icu.dev.demo.translit
Class AnyTransliterator
java.lang.Object
com.ibm.icu.text.Transliterator
com.ibm.icu.dev.demo.translit.AnyTransliterator
- All Implemented Interfaces:
StringTransform,Transform<String,String>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic classReturns a series of ranges corresponding to scripts.Nested classes/interfaces inherited from class com.ibm.icu.text.Transliterator
Transliterator.Factory, Transliterator.Position -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final booleanprivate static Transliteratorprivate AnyTransliterator.RunIteratorprivate Transliterator.Positionprivate StringFields inherited from class com.ibm.icu.text.Transliterator
FORWARD, REVERSE -
Constructor Summary
ConstructorsConstructorDescriptionAnyTransliterator(String targetName, UnicodeFilter filter) AnyTransliterator(String targetName, UnicodeFilter filter, AnyTransliterator.RunIterator it) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidhandleTransliterate(Replaceable text, Transliterator.Position offsets, boolean isIncremental) Abstract method that concrete subclasses define to implement their transliteration algorithm.static StringtoString(Transliterator.Position offsets) Methods inherited from class com.ibm.icu.text.Transliterator
addSourceTargetSet, baseToRules, createFromRules, filteredTransliterate, finishTransliteration, getAvailableIDs, getAvailableSources, getAvailableTargets, getAvailableVariants, getDisplayName, getDisplayName, getDisplayName, getElements, getFilter, getFilterAsUnicodeSet, getID, getInstance, getInstance, getInverse, getMaximumContextLength, getSourceSet, getTargetSet, handleGetSourceSet, registerAlias, registerAny, registerClass, registerFactory, registerInstance, setFilter, setID, setMaximumContextLength, toRules, transform, transliterate, transliterate, transliterate, transliterate, transliterate, transliterate, unregister
-
Field Details
-
DEBUG
static final boolean DEBUG- See Also:
-
targetName
-
it
-
run
-
hex
-
-
Constructor Details
-
AnyTransliterator
-
AnyTransliterator
-
-
Method Details
-
handleTransliterate
protected void handleTransliterate(Replaceable text, Transliterator.Position offsets, boolean isIncremental) Description copied from class:TransliteratorAbstract method that concrete subclasses define to implement their transliteration algorithm. This method handles both incremental and non-incremental transliteration. LetoriginalStartrefer to the value ofpos.startupon entry.- If
incrementalis false, then this method should transliterate all characters betweenpos.startandpos.limit. Upon returnpos.startmust ==pos.limit. - If
incrementalis true, then this method should transliterate all characters betweenpos.startandpos.limitthat can be unambiguously transliterated, regardless of future insertions of text atpos.limit. Upon return,pos.startshould be in the range [originalStart,pos.limit).pos.startshould be positioned such that characters [originalStart,pos.start) will not be changed in the future by this transliterator and characters [pos.start,pos.limit) are unchanged.
Implementations of this method should also obey the following invariants:
-
pos.limitandpos.contextLimitshould be updated to reflect changes in length of the text betweenpos.startandpos.limit. The differencepos.contextLimit - pos.limitshould not change. pos.contextStartshould not change.- Upon return, neither
pos.startnorpos.limitshould be less thanoriginalStart. - Text before
originalStartand text afterpos.limitshould not change. - Text before
pos.contextStartand text afterpos.contextLimitshould be ignored.
Subclasses may safely assume that all characters in [
pos.start,pos.limit) are filtered. In other words, the filter has already been applied by the time this method is called. SeefilteredTransliterate().This method is not for public consumption. Calling this method directly will transliterate [
pos.start,pos.limit) without applying the filter. End user code should calltransliterate()instead of this method. Subclass code should callfilteredTransliterate()instead of this method.- 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.isIncremental- 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:
- If
-
toString
-