Class ExpressionTemplates
java.lang.Object
ch.andre601.expressionparser.templates.ExpressionTemplates
Class containing a collection of pre-made
ExpressionTemplate
actions.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ExpressionTemplate
and
(Collection<ExpressionTemplate> operands) Returns aExpressionTemplate
who's boolean value returns true if and only if all providedExpressionTemplates
return true.static ExpressionTemplate
concat
(Collection<ExpressionTemplate> operands) Returns aExpressionTemplate
with the String values of the providedExpressionTemplates
merged together.static ExpressionTemplate
Returns aExpressionTemplate
who's boolean value returns true when the String value of the first ExpressionTemplate contains the String value of the second ExpressionTemplate.static ExpressionTemplate
Returns aExpressionTemplate
who's double value is the double value of the first ExpressionTemplate divided by the double value of the second ExpressionTemplate.static ExpressionTemplate
Returns aExpressionTemplate
who's boolean value returns true when the String value of the first ExpressionTemplate ends with the String value of the second ExpressionTemplate.static ExpressionTemplate
Returns aExpressionTemplate
who's boolean value is true if and only if the two providedExpressionTemplates
do have equal String values.static ExpressionTemplate
Returns aExpressionTemplate
who's boolean value is true if and only if the two providedExpressionTemplates
do have equal String values.static ExpressionTemplate
Returns aExpressionTemplate
who's boolean value returns true when the double value of the first ExpressionTemplate is larger than the double value of the second ExpressionTemplate.static ExpressionTemplate
Returns aExpressionTemplate
who's boolean value returns true when the double value of the first ExpressionTemplate is larger than or equal to the double value of the second ExpressionTemplate.static ExpressionTemplate
Returns aExpressionTemplate
who's boolean value returns true when the double value of the first ExpressionTemplate is less than the double value of the second ExpressionTemplate.static ExpressionTemplate
Returns aExpressionTemplate
who's boolean value returns true when the double value of the first ExpressionTemplate is less than or equal to the double value of the second ExpressionTemplate.static ExpressionTemplate
negate
(ExpressionTemplate template) Negates the providedExpressionTemplate's
output.static ExpressionTemplate
negateNumber
(ExpressionTemplate template) Negates the providedExpressionTemplate's
double value.static ExpressionTemplate
Returns aExpressionTemplate
who's boolean value is true if and only if the two providedExpressionTemplates
do not have equal String values.static ExpressionTemplate
Returns aExpressionTemplate
who's boolean value is true if and only if the two providedExpressionTemplates
do not have equal String values.static ExpressionTemplate
or
(Collection<ExpressionTemplate> operands) Returns aExpressionTemplate
who's boolean value returns true if any of the providedExpressionTemplates
returns true.static ExpressionTemplate
product
(Collection<ExpressionTemplate> operands) Returns aExpressionTemplate
who's double value is the product of all double values from the provided ExpressionTemplates.static ExpressionTemplate
Returns aExpressionTemplate
who's boolean value returns true when the String value of the first ExpressionTemplate starts with the String value of the second ExpressionTemplate.static ExpressionTemplate
Returns aExpressionTemplate
who's double value is the double value of the first ExpressionTemplate minus the double value of the second ExpressionTemplate.static ExpressionTemplate
sum
(Collection<ExpressionTemplate> operands) Returns aExpressionTemplate
who's double value is the sum of all double values from the provided ExpressionTemplates.
-
Constructor Details
-
ExpressionTemplates
public ExpressionTemplates()
-
-
Method Details
-
negate
Negates the providedExpressionTemplate's
output.- Parameters:
template
- The ExpressionTemplate to negate.- Returns:
- ExpressionTemplate with its value negated.
-
and
Returns aExpressionTemplate
who's boolean value returns true if and only if all providedExpressionTemplates
return true.- Parameters:
operands
- Collection of ExpressionTemplates to chain.- Returns:
- ExpressionTemplate who's boolean value returns true if and only if all provided ExpressionTemplates return true.
-
or
Returns aExpressionTemplate
who's boolean value returns true if any of the providedExpressionTemplates
returns true.- Parameters:
operands
- Collection of ExpressionTemplates to chain.- Returns:
- ExpressionTemplate who's boolean value returns true when any of the provided ExpressionTemplates returns true.
-
concat
Returns aExpressionTemplate
with the String values of the providedExpressionTemplates
merged together.- Parameters:
operands
- Collection of ExpressionTemplates to merge String values of.- Returns:
- ExpressionTemplate with the String values of all provided ExpressionTemplates merged together.
-
equal
Returns aExpressionTemplate
who's boolean value is true if and only if the two providedExpressionTemplates
do have equal String values.
This method is case-sensitive. For a case-insensitive option, useequalIgnoreCase
.- Parameters:
a
- The first ExpressionTemplate to check for equality.b
- The second ExpressionTemplate to check for equality.- Returns:
- ExpressionTemplate who's boolean value is true if and only if both ExpressionTemplate's String value is equal.
- See Also:
-
notEqual
Returns aExpressionTemplate
who's boolean value is true if and only if the two providedExpressionTemplates
do not have equal String values.
This method is case-sensitive. For a case-insensitive option, usenotEqualIgnoreCase
.- Parameters:
a
- The first ExpressionTemplate to check for equality.b
- The second ExpressionTemplate to check for equality.- Returns:
- ExpressionTemplate who's boolean value is true if and only if both ExpressionTemplate's String values are not equal.
- See Also:
-
equalIgnoreCase
Returns aExpressionTemplate
who's boolean value is true if and only if the two providedExpressionTemplates
do have equal String values.
This method is case-insensitive. For a case-insensitive option, useequal
.- Parameters:
a
- The first ExpressionTemplate to check for equality.b
- The second ExpressionTemplate to check for equality.- Returns:
- ExpressionTemplate who's boolean value is true if and only if both ExpressionTemplate's String value is equal.
- See Also:
-
notEqualIgnoreCase
Returns aExpressionTemplate
who's boolean value is true if and only if the two providedExpressionTemplates
do not have equal String values.
This method is case-sensitive. For a case-insensitive option, usenotEqual
.- Parameters:
a
- The first ExpressionTemplate to check for equality.b
- The second ExpressionTemplate to check for equality.- Returns:
- ExpressionTemplate who's boolean value is true if and only if both ExpressionTemplate's String values are not equal.
- See Also:
-
startsWith
Returns aExpressionTemplate
who's boolean value returns true when the String value of the first ExpressionTemplate starts with the String value of the second ExpressionTemplate.- Parameters:
a
- The first ExpressionTemplate to check the String value of.b
- The second ExpressionTemplate with the String value to look for in the first ExpressionTemplate.- Returns:
- True if the first ExpressionTemplate's String value starts with the String value of the second ExpressionTemplate.
-
endsWith
Returns aExpressionTemplate
who's boolean value returns true when the String value of the first ExpressionTemplate ends with the String value of the second ExpressionTemplate.- Parameters:
a
- The first ExpressionTemplate to check the String value of.b
- The second ExpressionTemplate with the String value to look for in the first ExpressionTemplate.- Returns:
- True if the first ExpressionTemplate's String value ends with the String value of the second ExpressionTemplate.
-
contains
Returns aExpressionTemplate
who's boolean value returns true when the String value of the first ExpressionTemplate contains the String value of the second ExpressionTemplate.- Parameters:
a
- The first ExpressionTemplate to check the String value of.b
- The second ExpressionTemplate with the String value to look for in the first ExpressionTemplate.- Returns:
- True if the first ExpressionTemplate's String value contains the String value of the second ExpressionTemplate.
-
greater
Returns aExpressionTemplate
who's boolean value returns true when the double value of the first ExpressionTemplate is larger than the double value of the second ExpressionTemplate.- Parameters:
a
- The first ExpressionTemplate to do a check with.b
- The second ExpressionTemplate to do a check with.- Returns:
- ExpressionTemplate who's boolean value returns true when the double value of the first ExpressionTemplate is larger than the double value of the second ExpressionTemplate.
-
greaterOrEqual
Returns aExpressionTemplate
who's boolean value returns true when the double value of the first ExpressionTemplate is larger than or equal to the double value of the second ExpressionTemplate.- Parameters:
a
- The first ExpressionTemplate to do a check with.b
- The second ExpressionTemplate to do a check with.- Returns:
- ExpressionTemplate who's boolean value returns true when the double value of the first ExpressionTemplate is larger than or equal to the double value of the second ExpressionTemplate.
-
less
Returns aExpressionTemplate
who's boolean value returns true when the double value of the first ExpressionTemplate is less than the double value of the second ExpressionTemplate.- Parameters:
a
- The first ExpressionTemplate to do a check with.b
- The second ExpressionTemplate to do a check with.- Returns:
- ExpressionTemplate who's boolean value returns true when the double value of the first ExpressionTemplate is less than the double value of the second ExpressionTemplate.
-
lessOrEqual
Returns aExpressionTemplate
who's boolean value returns true when the double value of the first ExpressionTemplate is less than or equal to the double value of the second ExpressionTemplate.- Parameters:
a
- The first ExpressionTemplate to do a check with.b
- The second ExpressionTemplate to do a check with.- Returns:
- ExpressionTemplate who's boolean value returns true when the double value of the first ExpressionTemplate is less than or equal to the double value of the second ExpressionTemplate.
-
sum
Returns aExpressionTemplate
who's double value is the sum of all double values from the provided ExpressionTemplates.- Parameters:
operands
- Collection of ExpressionTemplates to sum.- Returns:
- ExpressionTemplate who's double value is the sum of all double values of the provided ExpressionTemplates.
-
product
Returns aExpressionTemplate
who's double value is the product of all double values from the provided ExpressionTemplates.- Parameters:
operands
- Collection of ExpressionTemplates to sum.- Returns:
- ExpressionTemplate who's double value is the product of all double values of the provided ExpressionTemplates.
-
sub
Returns aExpressionTemplate
who's double value is the double value of the first ExpressionTemplate minus the double value of the second ExpressionTemplate.- Parameters:
a
- First ExpressionTemplate who's double value to use.b
- Second ExpressionTemplate who's double value to subtract from the first ExpressionTemplate's double value.- Returns:
- ExpressionTemplate who's double value is the double value of the first ExpressionTemplate minus the double value of the second ExpressionTemplate.
-
div
Returns aExpressionTemplate
who's double value is the double value of the first ExpressionTemplate divided by the double value of the second ExpressionTemplate.- Parameters:
a
- First ExpressionTemplate who's double value to use.b
- Second ExpressionTemplate who's double value to divide the double value of the first ExpressionTemplate with.- Returns:
- ExpressionTemplate who's double value is the double value of the first ExpressionTemplate divided by the double value of the second ExpressionTemplate.
-
negateNumber
Negates the providedExpressionTemplate's
double value.- Parameters:
template
- The ExpressionTemplate to negate the double value of.- Returns:
- ExpressionTemplate who's double value has been negated.
-