cz.cuni.amis.pogamut.sposh.elements
Class Arguments
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<Arguments.Argument>
cz.cuni.amis.pogamut.sposh.elements.Arguments
- All Implemented Interfaces:
- Iterable<Arguments.Argument>, Collection<Arguments.Argument>, List<Arguments.Argument>
public class Arguments
- extends AbstractList<Arguments.Argument>
This class represents the arguments of the 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 or index of the argument in the list or
arguments. Variable names have '$' prefix, e.g. $name. The indexes are simply
string representations of the numbers, e.g. index 3 is represented as "3".
Calling convention:
TODO: Properly document.
TODO: Properly test.
TODO: This probably doesn;t need to be abstract list
Example: call run("street", speed=14.5) will create
- Author:
- Honza Havlicek
Methods inherited from class java.util.AbstractList |
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList |
EMPTY
public static Arguments EMPTY
Arguments
public Arguments()
- Create a new list of call parameters.
Every added variable parameter
has to be checked against list of formal parameters.
Arguments
protected Arguments(Arguments parameters)
- Copy constructor. Beware, this doesn't copy reference to the formal
parameters.
- Parameters:
parameters
- orginal
get
public Arguments.Argument get(int index)
- Specified by:
get
in interface List<Arguments.Argument>
- Specified by:
get
in class AbstractList<Arguments.Argument>
size
public int size()
- Specified by:
size
in interface Collection<Arguments.Argument>
- Specified by:
size
in interface List<Arguments.Argument>
- Specified by:
size
in class AbstractCollection<Arguments.Argument>
add
public void add(int index,
Arguments.Argument element)
- Specified by:
add
in interface List<Arguments.Argument>
- Overrides:
add
in class AbstractList<Arguments.Argument>
addFormal
public boolean addFormal(Arguments.Argument element,
FormalParameters formalParams)
toString
public String toString()
- Get string representation of arguments (comma separated arguments,
compatible with lap).
- Overrides:
toString
in class AbstractCollection<Arguments.Argument>
- Returns:
- arguments separated with comma (e.g. |"Friends of peace.",
$when=now, $who=just_first_player|)
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.