Package net.sourceforge.plantuml.evalex
Class AbstractLazyFunction
- java.lang.Object
-
- net.sourceforge.plantuml.evalex.AbstractLazyFunction
-
- All Implemented Interfaces:
LazyFunction
- Direct Known Subclasses:
AbstractFunction
,Expression.LazyFunction
public abstract class AbstractLazyFunction extends java.lang.Object implements LazyFunction
Abstract implementation of a lazy function which implements all necessary methods with the exception of the main logic.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
booleanFunction
Whether this function is a boolean function.protected java.lang.String
name
Name of this function.protected int
numParams
Number of parameters expected for this function.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractLazyFunction(java.lang.String name, int numParams)
Creates a new function with given name and parameter count.protected
AbstractLazyFunction(java.lang.String name, int numParams, boolean booleanFunction)
Creates a new function with given name and parameter count.
-
Method Summary
All Methods Instance Methods Concrete 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.boolean
numParamsVaries()
Gets whether the number of accepted parameters varies.
That means that the function does accept an undefined amount of parameters.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sourceforge.plantuml.evalex.LazyFunction
lazyEval
-
-
-
-
Constructor Detail
-
AbstractLazyFunction
protected AbstractLazyFunction(java.lang.String name, int numParams, boolean booleanFunction)
Creates a new function with given name and parameter count.- Parameters:
name
- The name of the function.numParams
- The number of parameters for this function.-1
denotes a variable number of parameters.booleanFunction
- Whether this function is a boolean function.
-
AbstractLazyFunction
protected AbstractLazyFunction(java.lang.String name, int numParams)
Creates a new function with given name and parameter count.- Parameters:
name
- The name of the function.numParams
- The number of parameters for this function.-1
denotes a variable number of parameters.
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:LazyFunction
Gets the name of this function.
The name is use to invoke this function in the expression.- Specified by:
getName
in interfaceLazyFunction
- Returns:
- The name of this function.
-
getNumParams
public int getNumParams()
Description copied from interface:LazyFunction
Gets the number of parameters this function accepts.
A value of-1
denotes that this function accepts a variable number of parameters.- Specified by:
getNumParams
in interfaceLazyFunction
- Returns:
- The number of parameters this function accepts.
-
numParamsVaries
public boolean numParamsVaries()
Description copied from interface:LazyFunction
Gets whether the number of accepted parameters varies.
That means that the function does accept an undefined amount of parameters.- Specified by:
numParamsVaries
in interfaceLazyFunction
- Returns:
true
if the number of accepted parameters varies.
-
isBooleanFunction
public boolean isBooleanFunction()
Description copied from interface:LazyFunction
Gets whether this function evaluates to a boolean expression.- Specified by:
isBooleanFunction
in interfaceLazyFunction
- Returns:
true
if this function evaluates to a boolean expression.
-
-