|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.naturalcli.ParseResult
public class ParseResult
Encapsulate the data that restuls of a command parse. It means the parameters values and the list of tokens found.
Constructor Summary | |
---|---|
ParseResult(java.lang.Object[] parameterValues,
boolean[] tokensGiven)
Constructor |
Method Summary | |
---|---|
int |
getParameterCount()
Get the number of all possible parameters |
java.lang.Object |
getParameterValue(int parameterIndex)
Get the parameter value in the given index. |
java.lang.Object[] |
getParameterValues()
Get a copy of the parameter values |
boolean[] |
getTokensGiven()
Get a copy of the tokens given. |
boolean |
isTokenGiven(int tokenIndex)
Get if the token is given or not. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ParseResult(java.lang.Object[] parameterValues, boolean[] tokensGiven)
paramValues
- the ordered parameter values array. For optional
parameters not provided will be null
tokensGiven
- the ordered array with all the tokens saying if
each token is given or not. For non-optional tokens
the value will be always true
.Method Detail |
---|
public java.lang.Object getParameterValue(int parameterIndex)
parameterIndex
- the parameter index. This index is relative
only for the parameters.
public java.lang.Object[] getParameterValues()
public int getParameterCount()
public boolean isTokenGiven(int tokenIndex)
tokenIndex
- the token index.
true
if the token is given or false
if the token is not given (only for optional parameters).public boolean[] getTokensGiven()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |