Class CommandToken

java.lang.Object
net.apartium.cocoabeans.commands.lexer.CommandToken
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ArgumentParserToken, KeywordToken

@AvailableSince("0.0.37") public abstract class CommandToken extends Object implements Serializable
Command token for parsing commands
See Also:
  • Field Details

    • from

      protected final int from
    • to

      protected final int to
    • text

      protected final String text
  • Constructor Details

    • CommandToken

      protected CommandToken(int from, int to, String text)
      Create a new command token
      Parameters:
      from - starting index
      to - ending index
      text - the entire text of command
  • Method Details

    • from

      public int from()
      Gets the starting index
      Returns:
      the starting index
    • to

      public int to()
      Gets the ending index
      Returns:
      the ending index
    • getType

      public abstract CommandTokenType getType()
      Get the type of the token
      Returns:
      the type