public class StringArgumentStack extends java.lang.Object implements ArgumentStack
CommandContext
.Constructor and Description |
---|
StringArgumentStack(CommandContext context,
java.lang.String[] arguments,
boolean nonNullBoolean)
Create a new instance using the given context.
|
StringArgumentStack(CommandContext context,
java.lang.String arguments,
boolean nonNullBoolean)
Create a new instance using the given context.
|
Modifier and Type | Method and Description |
---|---|
CommandContext |
getContext()
Get the underlying context.
|
void |
markConsumed()
Set as completely consumed.
|
java.lang.String |
next()
Get the next string, which may come from the stack or a value flag.
|
java.lang.Boolean |
nextBoolean()
Get the next boolean, which may come from the stack or a value flag.
|
java.lang.Double |
nextDouble()
Get the next double, which may come from the stack or a value flag.
|
java.lang.Integer |
nextInt()
Get the next integer, which may come from the stack or a value flag.
|
java.lang.String |
remaining()
Get all remaining string values, which will consume the rest of the stack.
|
public StringArgumentStack(CommandContext context, java.lang.String[] arguments, boolean nonNullBoolean)
context
- the contextarguments
- a list of argumentsnonNullBoolean
- true to have nextBoolean()
return false instead of nullpublic StringArgumentStack(CommandContext context, java.lang.String arguments, boolean nonNullBoolean)
context
- the contextarguments
- an argument string to be parsednonNullBoolean
- true to have nextBoolean()
return false instead of nullpublic java.lang.String next() throws ParameterException
ArgumentStack
next
in interface ArgumentStack
ParameterException
- on a parameter errorpublic java.lang.Integer nextInt() throws ParameterException
ArgumentStack
nextInt
in interface ArgumentStack
ParameterException
- on a parameter errorpublic java.lang.Double nextDouble() throws ParameterException
ArgumentStack
nextDouble
in interface ArgumentStack
ParameterException
- on a parameter errorpublic java.lang.Boolean nextBoolean() throws ParameterException
ArgumentStack
nextBoolean
in interface ArgumentStack
ParameterException
- on a parameter errorpublic java.lang.String remaining() throws ParameterException
ArgumentStack
remaining
in interface ArgumentStack
ParameterException
- on a parameter errorpublic void markConsumed()
ArgumentStack
markConsumed
in interface ArgumentStack
public CommandContext getContext()
ArgumentStack
getContext
in interface ArgumentStack