Class ListOperator
java.lang.Object
ch.andre601.expressionparser.operator.Operator
ch.andre601.expressionparser.operator.ListOperator
The ListOperator can be used to handling a collection of
ExpressionTemplates
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionMethod to create anExpressionTemplate
from two ExpressionTemplates.abstract ExpressionTemplate
createTemplate
(List<ExpressionTemplate> operands) Method to create anExpressionTemplate
from a Collection of ExpressionTemplates.static ListOperator
of
(int priority, Function<Collection<ExpressionTemplate>, ExpressionTemplate> function) Static method to create a new ListOperator with itscreateTemplate
method utilizing the provided Function.Methods inherited from class ch.andre601.expressionparser.operator.Operator
getPriority, of
-
Constructor Details
-
ListOperator
public ListOperator(int priority) Constructor for creating a new ListOperator.- Parameters:
priority
- priority this ListOperator should have.
-
-
Method Details
-
of
public static ListOperator of(int priority, Function<Collection<ExpressionTemplate>, ExpressionTemplate> function) Static method to create a new ListOperator with itscreateTemplate
method utilizing the provided Function.- Parameters:
priority
- The priority this Operator should have.function
- The Function that should be used whencreateTemplate
is called for the ListOperator.- Returns:
- A new ListOperator.
-
createTemplate
Method to create anExpressionTemplate
from two ExpressionTemplates.- Specified by:
createTemplate
in classOperator
- Parameters:
a
- First ExpressionTemplate to use.b
- Second ExpressionTemplate to use.- Returns:
- ExpressionTemplate instance made from the provided ExpressionTemplates.
-
createTemplate
Method to create anExpressionTemplate
from a Collection of ExpressionTemplates.- Parameters:
operands
- Collection of ExpressionTemplates to use.- Returns:
- ExpressionTemplate instance made from the provided ExpressionTemplates.
-