Class ArgumentList


  • public class ArgumentList
    extends Object
    Represents the list of the arguments of a command.
    • Constructor Detail

      • ArgumentList

        public ArgumentList​(List<String> tokens)
    • Method Detail

      • tokenCount

        public int tokenCount()
        Gets the number of tokens (arguments) present in the list.
        Returns:
        the token count
      • get

        public String get​(int position)
        Returns the argument at the specified position.
        Parameters:
        position - the position of the argument
        Returns:
        the argument at the specified position
        Throws:
        IndexOutOfBoundsException - if the position is out of bounds
      • getAllAfter

        public String getAllAfter​(int position)
        Gets all arguments from the specified position to the last one, into one String resulting of the concatenation of all arguments (separated with a whitespace). Specifying a position <= 0 returns all arguments. Specifying a position >= tokenCount will result in an empty String.
        Parameters:
        position - the position of the first arguments
        Returns:
        all arguments into one concatenated String
      • getTokens

        public List<String> getTokens​(int maxCount)