public class StringArgumentStack extends Object implements ArgumentStack
CommandContext.| Constructor and Description |
|---|
StringArgumentStack(CommandContext context,
String[] arguments,
boolean nonNullBoolean)
Create a new instance using the given context.
|
StringArgumentStack(CommandContext context,
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.
|
String |
next()
Get the next string, which may come from the stack or a value flag.
|
Boolean |
nextBoolean()
Get the next boolean, which may come from the stack or a value flag.
|
Double |
nextDouble()
Get the next double, which may come from the stack or a value flag.
|
Integer |
nextInt()
Get the next integer, which may come from the stack or a value flag.
|
String |
remaining()
Get all remaining string values, which will consume the rest of the stack.
|
public StringArgumentStack(CommandContext context, String[] arguments, boolean nonNullBoolean)
context - the contextarguments - a list of argumentsnonNullBoolean - true to have nextBoolean() return false instead of nullpublic StringArgumentStack(CommandContext context, String arguments, boolean nonNullBoolean)
context - the contextarguments - an argument string to be parsednonNullBoolean - true to have nextBoolean() return false instead of nullpublic String next() throws ParameterException
ArgumentStacknext in interface ArgumentStackParameterException - on a parameter errorpublic Integer nextInt() throws ParameterException
ArgumentStacknextInt in interface ArgumentStackParameterException - on a parameter errorpublic Double nextDouble() throws ParameterException
ArgumentStacknextDouble in interface ArgumentStackParameterException - on a parameter errorpublic Boolean nextBoolean() throws ParameterException
ArgumentStacknextBoolean in interface ArgumentStackParameterException - on a parameter errorpublic String remaining() throws ParameterException
ArgumentStackremaining in interface ArgumentStackParameterException - on a parameter errorpublic void markConsumed()
ArgumentStackmarkConsumed in interface ArgumentStackpublic CommandContext getContext()
ArgumentStackgetContext in interface ArgumentStackCopyright © 2010-2014. All Rights Reserved.