Class Operator
java.lang.Object
ch.andre601.expressionparser.operator.Operator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ExpressionTemplateMethod to create anExpressionTemplatefrom two ExpressionTemplates.intReturns the priority set for this Operator.static Operatorof(int priority, BiFunction<ExpressionTemplate, ExpressionTemplate, ExpressionTemplate> function) Static method to create a new Operator with its createTemplate 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 its createTemplate method utilizing the provided BiFunction.- Parameters:
priority- The priority this Operator should have.function- The BiFunction that should be used when createTemplate 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 anExpressionTemplatefrom two ExpressionTemplates.- Parameters:
a- First ExpressionTemplate to use.b- Second ExpressionTemplate to use.- Returns:
- ExpressionTemplate instance made from the provided ExpressionTemplates.
-