Package net.sourceforge.plantuml.evalex
Interface LazyFunction
-
- All Known Subinterfaces:
Function
- All Known Implementing Classes:
AbstractFunction
,AbstractLazyFunction
,Expression.Function
,Expression.LazyFunction
public interface LazyFunction
Base interface which is required for lazily evaluated functions. A function is defined by a name, a number of parameters it accepts and of course the logic for evaluating the result.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getName()
Gets the name of this function.
The name is use to invoke this function in the expression.int
getNumParams()
Gets the number of parameters this function accepts.
A value of-1
denotes that this function accepts a variable number of parameters.boolean
isBooleanFunction()
Gets whether this function evaluates to a boolean expression.Expression.LazyNumber
lazyEval(java.util.List<Expression.LazyNumber> lazyParams)
Lazily evaluate this function.boolean
numParamsVaries()
Gets whether the number of accepted parameters varies.
That means that the function does accept an undefined amount of parameters.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Gets the name of this function.
The name is use to invoke this function in the expression.- Returns:
- The name of this function.
-
getNumParams
int getNumParams()
Gets the number of parameters this function accepts.
A value of-1
denotes that this function accepts a variable number of parameters.- Returns:
- The number of parameters this function accepts.
-
numParamsVaries
boolean numParamsVaries()
Gets whether the number of accepted parameters varies.
That means that the function does accept an undefined amount of parameters.- Returns:
true
if the number of accepted parameters varies.
-
isBooleanFunction
boolean isBooleanFunction()
Gets whether this function evaluates to a boolean expression.- Returns:
true
if this function evaluates to a boolean expression.
-
lazyEval
Expression.LazyNumber lazyEval(java.util.List<Expression.LazyNumber> lazyParams)
Lazily evaluate this function.- Parameters:
lazyParams
- The accepted parameters.- Returns:
- The lazy result of this function.
-
-