E - The type of the executorpublic class ArgumentChain<E>
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ArgumentChain.MatchedArgument
A wrapper for an argument that has been matched.
|
| Modifier and Type | Method and Description |
|---|---|
static <E> java.util.List<ArgumentChain<E>> |
buildChains(ArgumentNode<E,?> argument)
Build a list of all chains for the given argument node.
|
ArgumentNode<E,?> |
getArgument(int index)
Get an argument node by its index.
|
java.util.function.Function<ExecutionContext<E>,?> |
getExecutor()
Get the executor of this chain.
|
int |
getLength() |
int[] |
getWeights() |
java.util.List<ArgumentChain.MatchedArgument> |
parse(ExecutionContext<E> executionContext,
StringReader reader)
Parse the given input and return the parsed arguments.
|
void |
populateArguments(ExecutionContext<E> executionContext,
java.util.List<ArgumentChain.MatchedArgument> arguments)
Populate the given execution context with the given arguments.
|
java.lang.String |
toString() |
public static <E> java.util.List<ArgumentChain<E>> buildChains(ArgumentNode<E,?> argument)
E - The type of the executorargument - The argument nodejava.lang.IllegalArgumentException - If a duplicate argument name is found or the chain end has no executorpublic int getLength()
public int[] getWeights()
public ArgumentNode<E,?> getArgument(int index)
index - The indexjava.lang.IndexOutOfBoundsException - If the index is out of boundspublic java.util.List<ArgumentChain.MatchedArgument> parse(ExecutionContext<E> executionContext, StringReader reader) throws ChainExecutionException
executionContext - The execution contextreader - The input readerChainExecutionException - If the input can not be parsedpublic void populateArguments(ExecutionContext<E> executionContext, java.util.List<ArgumentChain.MatchedArgument> arguments)
executionContext - The execution contextarguments - The argumentspublic java.util.function.Function<ExecutionContext<E>,?> getExecutor()
public java.lang.String toString()
toString in class java.lang.Object