Enum Operator
- java.lang.Object
- 
- java.lang.Enum<Operator>
- 
- org.apache.tinkerpop.gremlin.process.traversal.Operator
 
 
- 
- All Implemented Interfaces:
- Serializable,- Comparable<Operator>,- BiFunction<Object,Object,Object>,- BinaryOperator<Object>
 
 public enum Operator extends Enum<Operator> implements BinaryOperator<Object> A set ofBinaryOperatorinstances that handle common operations for traversal steps.- Author:
- Marko A. Rodriguez (http://markorodriguez.com)
 
- 
- 
Enum Constant SummaryEnum Constants Enum Constant Description addAllTakes all objects in the secondCollectionand adds them to the first.andApplies "and" to boolean values.assignThe new incoming value (i.e.divA division function.maxSelects the larger of the values.minSelects the smaller of the values.minusA subtraction function.multA multiplication function.orApplies "or" to boolean values.sumAn addition function.sumLongSums and adds long values.
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static OperatorvalueOf(String name)Returns the enum constant of this type with the specified name.static Operator[]values()Returns an array containing the constants of this enum type, in the order they are declared.- 
Methods inherited from class java.lang.Enumclone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 - 
Methods inherited from interface java.util.function.BiFunctionandThen, apply
 
- 
 
- 
- 
- 
Enum Constant Detail- 
sumpublic static final Operator sum An addition function.- Since:
- 3.0.0-incubating
- See Also:
- NumberHelper.add(Number, Number)
 
 - 
minuspublic static final Operator minus A subtraction function.- Since:
- 3.0.0-incubating
- See Also:
- NumberHelper.sub(Number, Number)
 
 - 
multpublic static final Operator mult A multiplication function.- Since:
- 3.0.0-incubating
- See Also:
- NumberHelper.mul(Number, Number)
 
 - 
divpublic static final Operator div A division function.- Since:
- 3.0.0-incubating
- See Also:
- NumberHelper.div(Number, Number)
 
 - 
minpublic static final Operator min Selects the smaller of the values.- Since:
- 3.0.0-incubating
- See Also:
- NumberHelper.min(Number, Number)
 
 - 
maxpublic static final Operator max Selects the larger of the values.- Since:
- 3.0.0-incubating
- See Also:
- NumberHelper.max(Number, Number)
 
 - 
assignpublic static final Operator 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
 
 - 
andpublic static final Operator 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
 
 - 
orpublic static final Operator 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
 
 - 
addAllpublic static final Operator 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
 
 - 
sumLongpublic static final Operator sumLong Sums and adds long values.- Since:
- 3.2.0-incubating
 
 
- 
 - 
Method Detail- 
valuespublic static Operator[] values() Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Operator c : Operator.values()) System.out.println(c); - Returns:
- an array containing the constants of this enum type, in the order they are declared
 
 - 
valueOfpublic static Operator valueOf(String name) Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
- NullPointerException- if the argument is null
 
 
- 
 
-