Class Operator
java.lang.Object
ch.andre601.expressionparser.operator.Operator
- Direct Known Subclasses:
ListOperator
Class used to do operations on
ExpressionTemplates
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract ExpressionTemplate
Method to create anExpressionTemplate
from two ExpressionTemplates.int
Returns the priority set for this Operator.static Operator
of
(int priority, BiFunction<ExpressionTemplate, ExpressionTemplate, ExpressionTemplate> function) Static method to create a new Operator with itscreateTemplate
method utilizing the provided BiFunction.
-
Constructor Details
-
Operator
public Operator(int priority) Constructor for creating a new Operator.- Parameters:
priority
- Priority this Operator should have.
-
-
Method Details
-
of
public static Operator of(int priority, BiFunction<ExpressionTemplate, ExpressionTemplate, ExpressionTemplate> function) Static method to create a new Operator with itscreateTemplate
method utilizing the provided BiFunction.- Parameters:
priority
- The priority this Operator should have.function
- The BiFunction that should be used whencreateTemplate
is called for the Operator.- Returns:
- A new Operator.
-
getPriority
public int getPriority()Returns the priority set for this Operator.- Returns:
- Priority of this Operator.
-
createTemplate
Method to create anExpressionTemplate
from two ExpressionTemplates.- Parameters:
a
- First ExpressionTemplate to use.b
- Second ExpressionTemplate to use.- Returns:
- ExpressionTemplate instance made from the provided ExpressionTemplates.
-