Package icyllis.modernui.text.method

# Class ReplacementTransformationMethod

java.lang.Object
icyllis.modernui.text.method.ReplacementTransformationMethod

All Implemented Interfaces:
  `TransformationMethod`

Direct Known Subclasses:
  `SingleLineTransformationMethod`

public abstract class ReplacementTransformationMethod extends Object implements TransformationMethod
This transformation method causes the characters in the `getOriginal()` array to be replaced by the corresponding characters in the `getReplacement()` array.

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `ReplacementTransformationMethod()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected abstract char[]`
  `getOriginal()`
  Returns the list of characters that are to be replaced by other characters when displayed.
  `protected abstract char[]`
  `getReplacement()`
  Returns a parallel array of replacement characters for the ones that are to be replaced.
  `CharSequence`
  `getTransformation(CharSequence source, View v)`
  Returns a CharSequence that will mirror the contents of the source CharSequence but with the characters in `getOriginal()` replaced by ones from `getReplacement()`.
  `void`
  `onFocusChanged(View view, CharSequence sourceText, boolean focused, int direction, Rect previouslyFocusedRect)`
  This method is called when the TextView that uses this TransformationMethod gains or loses focus.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ReplacementTransformationMethod

    protected ReplacementTransformationMethod()

- ## Method Details

  - ### getOriginal

    protected abstract char[] getOriginal()
    Returns the list of characters that are to be replaced by other characters when displayed.

  - ### getReplacement

    protected abstract char[] getReplacement()
    Returns a parallel array of replacement characters for the ones that are to be replaced.

  - ### getTransformation

    @Nonnull public CharSequence getTransformation(@Nonnull CharSequence source, @Nonnull View v)
    Returns a CharSequence that will mirror the contents of the source CharSequence but with the characters in `getOriginal()` replaced by ones from `getReplacement()`.
    Specified by:
      `getTransformation` in interface `TransformationMethod`

  - ### onFocusChanged

    public void onFocusChanged(@Nonnull View view, @Nonnull CharSequence sourceText, boolean focused, int direction, @Nullable Rect previouslyFocusedRect)
    Description copied from interface: `TransformationMethod`
    This method is called when the TextView that uses this TransformationMethod gains or loses focus.
    Specified by:
      `onFocusChanged` in interface `TransformationMethod`