Enum Class GeneratorAlphabetRestriction

java.lang.Object
java.lang.Enum<GeneratorAlphabetRestriction>
org.emau.icmvc.ganimed.ttp.psn.enums.GeneratorAlphabetRestriction
All Implemented Interfaces:
Serializable, Comparable<GeneratorAlphabetRestriction>, Constable

public enum GeneratorAlphabetRestriction extends Enum<GeneratorAlphabetRestriction>
  • Enum Constant Details

  • Field Details

    • CONSIDER_DELIMITER_CHAR_AS_ALPHABET_SYMBOL

      public static final boolean CONSIDER_DELIMITER_CHAR_AS_ALPHABET_SYMBOL
      When this flag is true and the option to use the last symbol of an alphabet as delimiter is enabled, the generator's alphabet restrictions are computed for the core alphabet only without the delimiter symbol. Otherwise, the alphabet including the delimiter symbol must meet these restrictions.

      In the current implementation this flag is true.

      See Also:
  • Method Details

    • values

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

      public static GeneratorAlphabetRestriction valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • isValid

      public boolean isValid(Alphabet alphabet, boolean useLastCharAsDelimiterAfterXChars)
      Returns true if the specified alphabet fulfils this restriction.
      Parameters:
      alphabet - the alphabet to test
      Returns:
      true if the specified alphabet fulfils this restriction
    • validateAlphabet

      public void validateAlphabet(Alphabet alphabet, boolean useLastCharAsDelimiterAfterXChars) throws InvalidAlphabetException
      Throws:
      InvalidAlphabetException
    • getValidLength

      public int getValidLength()
      Returns invalid input: 'the length for valid alphabets if this restriction describes a constant length, otherwise 0]'.
      Returns:
      invalid input: 'the length for valid alphabets if this restriction describes a constant length, otherwise 0]'
    • getDescription

      public String getDescription()
      Returns a description for this restriction.
      Returns:
      a description for this restriction