Enum Class Operator
- All Implemented Interfaces:
Serializable,Comparable<Operator>,Constable,BiFunction<Object,,Object, Object> BinaryOperator<Object>
A set of
BinaryOperator instances that handle common operations for traversal steps.- Author:
- Marko A. Rodriguez (http://markorodriguez.com)
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionTakes all objects in the secondCollectionand adds them to the first.Applies "and" to boolean values.The new incoming value (i.e.A division function.Selects the larger of the values.Selects the smaller of the values.A subtraction function.A multiplication function.Applies "or" to boolean values.An addition function.Sums and adds long values. -
Method Summary
Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface java.util.function.BiFunction
andThen, apply
-
Enum Constant Details
-
sum
An addition function.- Since:
- 3.0.0-incubating
- See Also:
-
minus
A subtraction function.- Since:
- 3.0.0-incubating
- See Also:
-
mult
A multiplication function.- Since:
- 3.0.0-incubating
- See Also:
-
div
A division function.- Since:
- 3.0.0-incubating
- See Also:
-
min
Selects the smaller of the values.- Since:
- 3.0.0-incubating
- See Also:
-
max
Selects the larger of the values.- Since:
- 3.0.0-incubating
- See Also:
-
assign
The new incoming value (i.e. the second value to the function) is returned unchanged result in the assignment of that value to the object of theOperator.- Since:
- 3.1.0-incubating
-
and
Applies "and" to boolean values.a = true, b = null -> true a = false, b = null -> false a = null, b = true -> true a = null, b = false -> false a = null, b = null -> null- Since:
- 3.2.0-incubating
-
or
Applies "or" to boolean values.a = true, b = null -> true a = false, b = null -> false a = null, b = true -> true a = null, b = false -> false a = null, b = null -> null- Since:
- 3.2.0-incubating
-
addAll
Takes all objects in the secondCollectionand adds them to the first. If the first isnull, then the secondCollectionis returned and if the second isnullthen the first is returned. If both arenullthennullis returned. Arguments must be of typeMaporCollection. The semantics described above forCollectionare the same when applied to aMap.- Since:
- 3.2.0-incubating
-
sumLong
Sums and adds long values.- Since:
- 3.2.0-incubating
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-