1package com.runehive.game.world.entity.mob.player.command;
3import java.util.Arrays;
18 this.arguments = Arrays.stream(input.split(splitter)).toArray(String[]::new);
26 final int index = input.indexOf(splitter);
28 final String
command = index == -1 ? input : input.substring(0, index);
41 final String
string = input.substring(
position +
command.length()).trim();
67 public byte nextByte() throws NumberFormatException {
71 public double nextDouble() throws NumberFormatException {
75 public int nextInt() throws NumberFormatException {
79 public long nextLong() throws NumberFormatException {
83 public short nextShort() throws NumberFormatException {
87 public String
nextString() throws ArrayIndexOutOfBoundsException {
89 throw new ArrayIndexOutOfBoundsException(
"The next argument does not exist. [Size: " +
arguments.length +
", Attempted: " +
pointer +
"]");
96 final StringBuilder builder =
new StringBuilder();
101 return builder.toString().trim();
static CommandParser split(String input, String splitter)
static CommandParser split(String command, String input, String splitter)
static CommandParser split(CommandParser parser, String splitter)
boolean hasNext(int length)
CommandParser(String command, String input, String splitter)