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 interface
static class
Returns 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 boolean
private static Transliterator
private AnyTransliterator.RunIterator
private Transliterator.Position
private String
Fields 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 void
handleTransliterate
(Replaceable text, Transliterator.Position offsets, boolean isIncremental) Abstract method that concrete subclasses define to implement their transliteration algorithm.static String
toString
(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:Transliterator
Abstract method that concrete subclasses define to implement their transliteration algorithm. This method handles both incremental and non-incremental transliteration. LetoriginalStart
refer to the value ofpos.start
upon entry.- If
incremental
is false, then this method should transliterate all characters betweenpos.start
andpos.limit
. Upon returnpos.start
must ==pos.limit
. - If
incremental
is true, then this method should transliterate all characters betweenpos.start
andpos.limit
that can be unambiguously transliterated, regardless of future insertions of text atpos.limit
. Upon return,pos.start
should be in the range [originalStart
,pos.limit
).pos.start
should 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.limit
andpos.contextLimit
should be updated to reflect changes in length of the text betweenpos.start
andpos.limit
. The differencepos.contextLimit - pos.limit
should not change. pos.contextStart
should not change.- Upon return, neither
pos.start
norpos.limit
should be less thanoriginalStart
. - Text before
originalStart
and text afterpos.limit
should not change. - Text before
pos.contextStart
and text afterpos.contextLimit
should 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:
handleTransliterate
in 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.limit
and act accordingly. Otherwise, transliterate all text betweenpos.start
andpos.limit
and movepos.start
up topos.limit
.- See Also:
- If
-
toString
-