Class Token<T>

  • Type Parameters:
    T - The identifier type.
    All Implemented Interfaces:
    CharSequence, Iterable<Chare>

    public final class Token<T>
    extends Stringe
    Represents a Token with a string value and a custom identifier.
    • Constructor Detail

      • Token

        public Token​(T id,
                     String value)
        Constructs a new Token from the specified string.
        Parameters:
        id - The identifier of the token.
        value - The underlying string value.
      • Token

        public Token​(T id,
                     Stringe value)
        Constructs a new Token from the specified Stringe.
        Parameters:
        id - The identifier of the token.
        value - The Stringe to use for the token.
    • Method Detail

      • getId

        public T getId()
        Returns the token identifier.
        Returns:
        The identifier of the token.
      • toString

        public String toString()
        Returns a string representation of the current token.
        Specified by:
        toString in interface CharSequence
        Overrides:
        toString in class Stringe
        Returns:
        A string containing the value of the token, as well as its line and column numbers.