Class ExpressionTemplates
java.lang.Object
ch.andre601.expressionparser.templates.ExpressionTemplates
Class containing a collection of pre-made
ExpressionTemplate actions.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ExpressionTemplateand(Collection<ExpressionTemplate> operands) Returns aExpressionTemplatewho's boolean value returns true if and only if all provided ExpressionTemplates return true.static ExpressionTemplateconcat(Collection<ExpressionTemplate> operands) Returns aExpressionTemplatewith the String values of the provided ExpressionTemplates merged together.static ExpressionTemplateReturns aExpressionTemplatewho's boolean value returns true when the String value of the first ExpressionTemplate contains the String value of the second ExpressionTemplate.static ExpressionTemplateReturns aExpressionTemplatewho's boolean value returns true when the String value of the first ExpressionTemplate contains the String value of the second ExpressionTemplate.static ExpressionTemplateReturns aExpressionTemplatewho's double value is the double value of the first ExpressionTemplate divided by the double value of the second ExpressionTemplate.static ExpressionTemplateReturns aExpressionTemplatewho's boolean value returns true when the String value of the first ExpressionTemplate ends with the String value of the second ExpressionTemplate.static ExpressionTemplateReturns aExpressionTemplatewho's boolean value returns true when the String value of the first ExpressionTemplate ends with the String value of the second ExpressionTemplate.static ExpressionTemplateReturns aExpressionTemplatewho's boolean value is true if and only if the two provided ExpressionTemplates do have equal String values.static ExpressionTemplateReturns aExpressionTemplatewho's boolean value is true if and only if the two provided ExpressionTemplates do have equal String values.static ExpressionTemplateReturns aExpressionTemplatewho's boolean value returns true when the double value of the first ExpressionTemplate is larger than the double value of the second ExpressionTemplate.static ExpressionTemplateReturns aExpressionTemplatewho'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 ExpressionTemplateReturns aExpressionTemplatewho's boolean value returns true when the double value of the first ExpressionTemplate is less than the double value of the second ExpressionTemplate.static ExpressionTemplateReturns aExpressionTemplatewho'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 ExpressionTemplatenegate(ExpressionTemplate template) Negates the provided ExpressionTemplate's output.static ExpressionTemplatenegateNumber(ExpressionTemplate template) Negates the provided ExpressionTemplate's double value.static ExpressionTemplateReturns aExpressionTemplatewho's boolean value is true if and only if the two provided ExpressionTemplates do not have equal String values.static ExpressionTemplateReturns aExpressionTemplatewho's boolean value is true if and only if the two provided ExpressionTemplates do not have equal String values.static ExpressionTemplateor(Collection<ExpressionTemplate> operands) Returns aExpressionTemplatewho's boolean value returns true if any of the provided ExpressionTemplates returns true.static ExpressionTemplateproduct(Collection<ExpressionTemplate> operands) Returns aExpressionTemplatewho's double value is the product of all double values from the provided ExpressionTemplates.static ExpressionTemplateReturns aExpressionTemplatewho's boolean value returns true when the String value of the first ExpressionTemplate starts with the String value of the second ExpressionTemplate.static ExpressionTemplateReturns aExpressionTemplatewho's boolean value returns true when the String value of the first ExpressionTemplate starts with the String value of the second ExpressionTemplate.static ExpressionTemplateReturns aExpressionTemplatewho's double value is the double value of the first ExpressionTemplate minus the double value of the second ExpressionTemplate.static ExpressionTemplatesum(Collection<ExpressionTemplate> operands) Returns aExpressionTemplatewho's double value is the sum of all double values from the provided ExpressionTemplates.
-
Constructor Details
-
ExpressionTemplates
public ExpressionTemplates()
-
-
Method Details
-
negate
Negates the provided ExpressionTemplate's output.- Parameters:
template- The ExpressionTemplate to negate.- Returns:
- ExpressionTemplate with its value negated.
-
and
Returns aExpressionTemplatewho's boolean value returns true if and only if all provided ExpressionTemplates 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 aExpressionTemplatewho's boolean value returns true if any of the provided ExpressionTemplates 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 aExpressionTemplatewith the String values of the provided ExpressionTemplates 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 aExpressionTemplatewho's boolean value is true if and only if the two provided ExpressionTemplates do have equal String values.
This method is case-sensitive. For a case-insensitive option, use equalIgnoreCase.- 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 aExpressionTemplatewho's boolean value is true if and only if the two provided ExpressionTemplates do not have equal String values.
This method is case-sensitive. For a case-insensitive option, use notEqualIgnoreCase.- 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 aExpressionTemplatewho's boolean value is true if and only if the two provided ExpressionTemplates do have equal String values.
This method is case-insensitive. For a case-insensitive option, use equal.- 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 aExpressionTemplatewho's boolean value is true if and only if the two provided ExpressionTemplates do not have equal String values.
This method is case-sensitive. For a case-insensitive option, use notEqual.- 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 aExpressionTemplatewho'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.
-
startsWithIgnoreCase
Returns aExpressionTemplatewho's boolean value returns true when the String value of the first ExpressionTemplate starts with the String value of the second ExpressionTemplate.
This check ignores the casing of the provided ExpressionTemplates by lowercasing their String values.- 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 aExpressionTemplatewho'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.
-
endsWithIgnoreCase
Returns aExpressionTemplatewho's boolean value returns true when the String value of the first ExpressionTemplate ends with the String value of the second ExpressionTemplate.
This check ignores the casing of the provided ExpressionTemplates by lowercasing their String values.- 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 aExpressionTemplatewho'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.
-
containsIgnoreCase
Returns aExpressionTemplatewho's boolean value returns true when the String value of the first ExpressionTemplate contains the String value of the second ExpressionTemplate.
This check ignores the casing of the provided ExpressionTemplates by lowercasing their String values.- 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 aExpressionTemplatewho'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 aExpressionTemplatewho'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 aExpressionTemplatewho'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 aExpressionTemplatewho'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 aExpressionTemplatewho'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 aExpressionTemplatewho'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 aExpressionTemplatewho'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 aExpressionTemplatewho'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 provided ExpressionTemplate's double value.- Parameters:
template- The ExpressionTemplate to negate the double value of.- Returns:
- ExpressionTemplate who's double value has been negated.
-