public class Arguments extends AbstractList<Arguments.Argument>
PrimitiveCall. PrimitiveCall
can reference either normal IAction, ActionPattern or Competence
that will get these arguments, mix them with their own FormalParameters
and create the values for the Action/C/AP.
Arguments is stored as list of Arguments.Argument, each argument is basically
(key; argument) pair. Arguments are sorted according to the key. What is the
key? Either a variable name of the argument in the list or
arguments. Variable names have '$' prefix, e.g. $name.
TODO: This probably doesn;t need to be abstract list
Example: call run($dest="street", $speed=$number) will create Arguments
with two arguments, value arg $dest and variable arg $speed.| Modifier and Type | Class and Description |
|---|---|
static class |
Arguments.Argument
Representation of argument in Yaposh plan.
|
protected static class |
Arguments.ValueArgument
This argument is a static value, neverchanging, e.g.
|
protected static class |
Arguments.VariableArgument
This argument value is dependent on value of some variable.
|
| Modifier and Type | Field and Description |
|---|---|
static Arguments |
EMPTY |
modCount| Modifier | Constructor and Description |
|---|---|
|
Arguments()
Create a new list of call parameters.
|
protected |
Arguments(Arguments parameters)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
Arguments.Argument element)
Add argument at specified index.
|
boolean |
addFormal(Arguments.Argument newArgument,
FormalParameters formalParams)
Add argument to this list + following check: This list doesn't containe argument with same name as @newArgument.
|
Arguments.Argument |
get(int index)
Get indexth argument according to order of specification.
|
String[] |
getAllNames()
Get all names of arguments, sorted.
|
int |
size() |
String |
toString()
Get string representation of arguments (comma separated arguments,
compatible with lap).
|
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArrayparallelStream, removeIf, streampublic static Arguments EMPTY
public Arguments()
Every added variable parameter has to be checked against list of formal parameters.
protected Arguments(Arguments parameters)
parameters - orginalpublic String[] getAllNames()
public Arguments.Argument get(int index)
get in interface List<Arguments.Argument>get in class AbstractList<Arguments.Argument>index - Index of argument.public int size()
size in interface Collection<Arguments.Argument>size in interface List<Arguments.Argument>size in class AbstractCollection<Arguments.Argument>arguments does this list hold.public void add(int index,
Arguments.Argument element)
add in interface List<Arguments.Argument>add in class AbstractList<Arguments.Argument>index - Index at which to add argumentelement - Argument to addpublic boolean addFormal(Arguments.Argument newArgument, FormalParameters formalParams)
newArgument - Argument to add to this list.formalParams - Parameters that are used for check if @newArgument is varaiblae arg.IllegalArgumentException - If the check failspublic String toString()
toString in class AbstractCollection<Arguments.Argument>Copyright © 2018 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All rights reserved.