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 booleanbooleanFunctionWhether this function is a boolean function.protected java.lang.StringnameName of this function.protected intnumParamsNumber of parameters expected for this function.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractLazyFunction(java.lang.String name, int numParams)Creates a new function with given name and parameter count.protectedAbstractLazyFunction(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.StringgetName()Gets the name of this function.
The name is use to invoke this function in the expression.intgetNumParams()Gets the number of parameters this function accepts.
A value of-1denotes that this function accepts a variable number of parameters.booleanisBooleanFunction()Gets whether this function evaluates to a boolean expression.booleannumParamsVaries()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.-1denotes 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.-1denotes a variable number of parameters.
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:LazyFunctionGets the name of this function.
The name is use to invoke this function in the expression.- Specified by:
getNamein interfaceLazyFunction- Returns:
- The name of this function.
-
getNumParams
public int getNumParams()
Description copied from interface:LazyFunctionGets the number of parameters this function accepts.
A value of-1denotes that this function accepts a variable number of parameters.- Specified by:
getNumParamsin interfaceLazyFunction- Returns:
- The number of parameters this function accepts.
-
numParamsVaries
public boolean numParamsVaries()
Description copied from interface:LazyFunctionGets whether the number of accepted parameters varies.
That means that the function does accept an undefined amount of parameters.- Specified by:
numParamsVariesin interfaceLazyFunction- Returns:
trueif the number of accepted parameters varies.
-
isBooleanFunction
public boolean isBooleanFunction()
Description copied from interface:LazyFunctionGets whether this function evaluates to a boolean expression.- Specified by:
isBooleanFunctionin interfaceLazyFunction- Returns:
trueif this function evaluates to a boolean expression.
-
-