Class FunctionCallPrototype
Wraps a FunctionCall
and provides conveniences for updating the function call arguments.
Exists primarily for binding purposes.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddArgument
(Optional<String> argumentName, String argFormat, Object... formatArgs) nz.org.riskscape.rl.ast.FunctionCall
build()
protected boolean
boolean
List<nz.org.riskscape.rl.ast.FunctionCall.Argument>
nz.org.riskscape.rl.ast.FunctionCall
int
hashCode()
setArgument
(int i, String argFormat, Object... formatArgs) Sets or replaces argument i with theExpression
produced from argFormat and formatArgs.setArgument
(int i, Optional<String> argumentName, String argFormat, Object... formatArgs) Sets or replaces argument i with theExpression
produced from argFormat and formatArgs.setFirstArgument
(String argFormat, Object... formatArgs) Same assetArgument(int, java.lang.String, java.lang.Object...)
for argument 0.
-
Constructor Details
-
FunctionCallPrototype
public FunctionCallPrototype(nz.org.riskscape.rl.ast.FunctionCall prototype)
-
-
Method Details
-
setArgument
Sets or replaces argument i with the
Expression
produced from argFormat and formatArgs. If the expression is invalid then exceptions will be thrown fromExpressionParser.parse(java.lang.String)
.Arguments must set in a manner that will not create a hole in the argument list at any time else
IllegalArgumentException
will result. That is it is not possible to set arg 2 if arg 1 does not yet exist.- Parameters:
i
- index of the argument to set (zero based)argFormat
- string format of expression to set argument withformatArgs
- args (if any) required by argFormat- Returns:
- FunctionCallPrototype Expression with the replaced/set argument
-
setArgument
public FunctionCallPrototype setArgument(int i, Optional<String> argumentName, String argFormat, Object... formatArgs) Sets or replaces argument i with the
Expression
produced from argFormat and formatArgs. If the expression is invalid then exceptions will be thrown fromExpressionParser.parse(java.lang.String)
.Arguments must set in a manner that will not create a hole in the argument list at any time else
IllegalArgumentException
will result. That is it is not possible to set arg 2 if arg 1 does not yet exist.- Parameters:
i
- index of the argument to set (zero based)argumentName
- optional argument nameargFormat
- string format of expression to set argument withformatArgs
- args (if any) required by argFormat- Returns:
- FunctionCallPrototype Expression with the replaced/set argument (with optional arg name)
-
setFirstArgument
Same as
setArgument(int, java.lang.String, java.lang.Object...)
for argument 0. -
addArgument
public FunctionCallPrototype addArgument(Optional<String> argumentName, String argFormat, Object... formatArgs) -
build
public nz.org.riskscape.rl.ast.FunctionCall build() -
equals
-
canEqual
-
hashCode
public int hashCode() -
getPrototype
public nz.org.riskscape.rl.ast.FunctionCall getPrototype() -
getNewArguments
-