Enum Lexer.Token.Type

java.lang.Object
java.lang.Enum<Lexer.Token.Type>
com.github.zafarkhaja.semver.expr.Lexer.Token.Type
All Implemented Interfaces:
Stream.ElementType<Lexer.Token>, Serializable, Comparable<Lexer.Token.Type>
Enclosing class:
Lexer.Token

static enum Lexer.Token.Type extends Enum<Lexer.Token.Type> implements Stream.ElementType<Lexer.Token>
Valid token types.
  • Enum Constant Details

  • Field Details

    • pattern

      final Pattern pattern
      A pattern matching this type.
  • Constructor Details

    • Type

      private Type(String regexp)
      Constructs a token type with a regular expression for the pattern.
      Parameters:
      regexp - the regular expression for the pattern
      See Also:
  • Method Details

    • values

      public static Lexer.Token.Type[] 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 Lexer.Token.Type 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
    • toString

      public String toString()
      Returns the string representation of this type.
      Overrides:
      toString in class Enum<Lexer.Token.Type>
      Returns:
      the string representation of this type
    • isMatchedBy

      public boolean isMatchedBy(Lexer.Token token)
      Checks if the specified element matches this type.
      Specified by:
      isMatchedBy in interface Stream.ElementType<Lexer.Token>
      Parameters:
      token - the element to be tested
      Returns:
      true if the element matches this type or false otherwise