Enum ShorteningMode

java.lang.Object
java.lang.Enum<ShorteningMode>
com.betterdiff.lyrics.pairing.ShorteningMode
All Implemented Interfaces:
Serializable, Comparable<ShorteningMode>, Constable

public enum ShorteningMode
extends Enum<ShorteningMode>
It provides methods how to make string shorter to ease the computation of longest common subsequence value.
Author:
troomar
  • Enum Constant Details

    • DO_NOT_SHORTHEN

      public static final ShorteningMode DO_NOT_SHORTHEN
    • FIRST_AND_LAST_LETTER

      public static final ShorteningMode FIRST_AND_LAST_LETTER
    • FIRST_LETTER_ONLY

      public static final ShorteningMode FIRST_LETTER_ONLY
  • Method Details

    • values

      public static ShorteningMode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ShorteningMode valueOf​(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getId

      public int getId()
    • shorten

      public abstract String shorten​(String fullString)
      Shorten the string according to selected method.
      Parameters:
      fullString - String to shorten.
      Returns:
      Shortened string.