Package jadex.rules.rulesystem.rules
Class Operator
- java.lang.Object
-
- jadex.rules.rulesystem.rules.Operator
-
public class Operator extends java.lang.Object
The operator class contains the implementation of all operators for evaluating two values.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Operator.Contains
Test if an object is contained in a collection.static class
Operator.Equal
Test two objects for equality.static class
Operator.Excludes
Test if an object is excluded from a collection.static class
Operator.Greater
Test two objects for greater than.static class
Operator.GreaterOrEqual
Test two objects for greater or equal.static class
Operator.InstanceOf
Test if an object is instanceof a class.static class
Operator.Less
Test two objects for less than.static class
Operator.LessOrEqual
Test two objects for less or equal.static class
Operator.Matches
Requires strings as both parameters.static class
Operator.NotEqual
Test two objects for non-equality.static class
Operator.StartsWith
Requires strings as both parameters.
-
Constructor Summary
Constructors Constructor Description Operator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static int
compare(java.lang.Object val1, java.lang.Object val2)
Compare two values.protected static boolean
contains(java.lang.Object val1, java.lang.Object val2)
Test if a collection contains a value.
-
-
-
Method Detail
-
compare
protected static int compare(java.lang.Object val1, java.lang.Object val2)
Compare two values.- Parameters:
val1
- The first value.val2
- The second value.- Returns:
- A negative integer, zero, or a positive integer as the first value is less than, equal to, or greater than the second value.
- Throws:
java.lang.ClassCastException
- when the values are not comparable.
-
contains
protected static boolean contains(java.lang.Object val1, java.lang.Object val2)
Test if a collection contains a value.- Parameters:
val1
- The collection.val2
- The value to test.- Returns:
- True, if contained.
-
-