Class P<V>
java.lang.Object
org.apache.tinkerpop.gremlin.process.traversal.P<V>
- All Implemented Interfaces:
Serializable,Cloneable,Predicate<V>
Predefined
Predicate values that can be used to define filters to has() and where().- Author:
- Marko A. Rodriguez (http://markorodriguez.com), Stephen Mallette (http://stephen.genoprime.com)
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedP(PBiPredicate<V, V> biPredicate, Collection<V> literals, Map<String, V> variables, boolean isCollection) P(PBiPredicate<V, V> biPredicate, List<Traversal.Admin<?, ?>> traversalValues) Constructs aPwith multiple child traversals resolved at runtime against the current traverser.P(PBiPredicate<V, V> biPredicate, org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> value) P(PBiPredicate<V, V> biPredicate, Traversal.Admin<?, ?> traversalValue) Constructs aPwith a child traversal whose result is resolved at runtime against the current traverser.P(PBiPredicate<V, V> biPredicate, V value) -
Method Summary
Modifier and TypeMethodDescriptionstatic <V> P<V>between(org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> first, org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> second) Determines if a value is within (inclusive) of the range of the two specified values.static <V> P<V>between(V first, V second) Determines if a value is within (inclusive) of the range of the two specified values.clone()static voidcollectTraversals(P<?> p, List<Traversal.Admin<?, ?>> traversals) Recursively collects all child traversals from a predicate tree.static <V> P<V>eq(org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> value) Determines if values are equal.static <V> P<V>Determines if values are equal using a child traversal resolved at runtime.static <V> P<V>eq(V value) Determines if values are equal.booleanList<Traversal.Admin<?,?>> Gets the child traversals held by this predicate.Set<org.apache.tinkerpop.gremlin.process.traversal.step.GValue<?>>Get the name of the predicategetValue()Gets the current value to be passed to the predicate for testing.static <V> P<V>gt(org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> value) Determines if a value is greater than another.static <V> P<V>Determines if a value is greater than another using a child traversal resolved at runtime.static <V> P<V>gt(V value) Determines if a value is greater than another.static <V> P<V>gte(org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> value) Determines if a value is greater than or equal to another.static <V> P<V>Determines if a value is greater than or equal to another using a child traversal resolved at runtime.static <V> P<V>gte(V value) Determines if a value is greater than or equal to another.inthashCode()booleanDetermines if this predicate holds a child traversal whose result is resolved at runtime.static <V> P<V>inside(org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> first, org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> second) Determines if a value is within (exclusive) the range of the two specified values.static <V> P<V>inside(V first, V second) Determines if a value is within (exclusive) the range of the two specified values.booleanbooleanReturnstrueif the most recent call toresolve(Traverser.Admin)produced no results for a scalar predicate, meaning there is no meaningful comparison value.static <V> P<V>lt(org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> value) Determines if a value is less than another.static <V> P<V>Determines if a value is less than another using a child traversal resolved at runtime.static <V> P<V>lt(V value) Determines if a value is less than another.static <V> P<V>lte(org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> value) Determines if a value is less than or equal to another.static <V> P<V>Determines if a value is less than or equal to another using a child traversal resolved at runtime.static <V> P<V>lte(V value) Determines if a value is less than or equal to another.negate()static <V> P<V>neq(org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> value) Determines if values are not equal.static <V> P<V>Determines if values are not equal using a child traversal resolved at runtime.static <V> P<V>neq(V value) Determines if values are not equal.static <V> P<V>The opposite of the specifiedP.static <V> P<V>outside(org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> first, org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> second) Determines if a value is not within (exclusive) of the range of the two specified values.static <V> P<V>outside(V first, V second) Determines if a value is not within (exclusive) of the range of the two specified values.voidresolve(Traverser.Admin<?> traverser) Resolves the child traversal(s) against the given traverser, replacing the traversal value with the resolved literal(s) for this test cycle.voidstatic Ptest(PBiPredicate biPredicate, Object value) Construct an instance ofPfrom aBiPredicate.booleantoString()static <V> P<V>Sugar method for Java/Groovy embedded cases only, determines if a value is of a type denoted by class.static <V> P<V>Determines if a value is of a type denoted by String key of GlobalTypeCache.static <V> P<V>Determines if a value is of a type denoted byGType.voidupdateVariable(String name, Object value) static <V> P<V>within(Collection<V> value) Determines if a value is within the specified list of values.static <V> P<V>within(org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V>... values) Determines if a value is within the specified list of values.static <V> P<V>Determines if a value is within the results of a child traversal resolved at runtime.static <V> P<V>Determines if a value is within the results of child traversals resolved at runtime.static <V> P<V>within(V... values) Determines if a value is within the specified list of values.static <V> P<V>without(Collection<V> value) Determines if a value is not within the specified list of values.static <V> P<V>without(org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V>... values) Determines if a value is not within the specified list of values.static <V> P<V>Determines if a value is not within the results of a child traversal resolved at runtime.static <V> P<V>Determines if a value is not within the results of child traversals resolved at runtime.static <V> P<V>without(V... values) Determines if a value is not within the specified list of values.
-
Field Details
-
biPredicate
-
variables
-
literals
-
-
Constructor Details
-
P
-
P
public P(PBiPredicate<V, V> biPredicate, org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> value) -
P
protected P(PBiPredicate<V, V> biPredicate, Collection<V> literals, Map<String, V> variables, boolean isCollection) -
P
Constructs aPwith a child traversal whose result is resolved at runtime against the current traverser. The literals and variables are left at their defaults and will be populated whenresolve(Traverser.Admin)is called. -
P
Constructs aPwith multiple child traversals resolved at runtime against the current traverser. Only valid for collection predicates (Contains.within,Contains.without). Each traversal contributes its first result only. The literals and variables are left at their defaults and will be populated whenresolve(Traverser.Admin)is called.- Since:
- 4.0.0
-
-
Method Details
-
getBiPredicate
-
getPredicateName
Get the name of the predicate -
getValue
Gets the current value to be passed to the predicate for testing. -
setValue
-
test
-
hashCode
public int hashCode() -
equals
-
toString
-
negate
-
and
-
or
-
clone
-
isParameterized
public boolean isParameterized() -
updateVariable
-
getGValues
-
hasTraversal
public boolean hasTraversal()Determines if this predicate holds a child traversal whose result is resolved at runtime. -
isResolvedEmpty
public boolean isResolvedEmpty()Returnstrueif the most recent call toresolve(Traverser.Admin)produced no results for a scalar predicate, meaning there is no meaningful comparison value. -
getChildTraversals
Gets the child traversals held by this predicate. Returnsnullwhen this predicate uses literal values or variables.- Since:
- 4.0.0
-
resolve
Resolves the child traversal(s) against the given traverser, replacing the traversal value with the resolved literal(s) for this test cycle. If no traversal is present, this method returns immediately. -
collectTraversals
Recursively collects all child traversals from a predicate tree. HandlesConnectiveP(recurses into children) andNotP(recurses into wrapped predicate). -
eq
Determines if values are equal.- Since:
- 3.0.0-incubating
-
eq
Determines if values are equal.- Since:
- 3.8.0
-
eq
Determines if values are equal using a child traversal resolved at runtime.- Since:
- 4.0.0
-
neq
Determines if values are not equal.- Since:
- 3.0.0-incubating
-
neq
Determines if values are not equal.- Since:
- 3.8.0
-
neq
Determines if values are not equal using a child traversal resolved at runtime.- Since:
- 4.0.0
-
lt
Determines if a value is less than another.- Since:
- 3.0.0-incubating
-
lt
Determines if a value is less than another.- Since:
- 3.8.0
-
lt
Determines if a value is less than another using a child traversal resolved at runtime.- Since:
- 4.0.0
-
lte
Determines if a value is less than or equal to another.- Since:
- 3.0.0-incubating
-
lte
Determines if a value is less than or equal to another.- Since:
- 3.8.0
-
lte
Determines if a value is less than or equal to another using a child traversal resolved at runtime.- Since:
- 4.0.0
-
gt
Determines if a value is greater than another.- Since:
- 3.0.0-incubating
-
gt
Determines if a value is greater than another.- Since:
- 3.8.0
-
gt
Determines if a value is greater than another using a child traversal resolved at runtime.- Since:
- 4.0.0
-
gte
Determines if a value is greater than or equal to another.- Since:
- 3.0.0-incubating
-
gte
Determines if a value is greater than or equal to another.- Since:
- 3.8.0
-
gte
Determines if a value is greater than or equal to another using a child traversal resolved at runtime.- Since:
- 4.0.0
-
inside
Determines if a value is within (exclusive) the range of the two specified values.- Since:
- 3.0.0-incubating
-
inside
public static <V> P<V> inside(org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> first, org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> second) Determines if a value is within (exclusive) the range of the two specified values.- Since:
- 3.8.0
-
outside
Determines if a value is not within (exclusive) of the range of the two specified values.- Since:
- 3.0.0-incubating
-
outside
public static <V> P<V> outside(org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> first, org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> second) Determines if a value is not within (exclusive) of the range of the two specified values.- Since:
- 3.8.0
-
between
Determines if a value is within (inclusive) of the range of the two specified values.- Since:
- 3.0.0-incubating
-
between
public static <V> P<V> between(org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> first, org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> second) Determines if a value is within (inclusive) of the range of the two specified values.- Since:
- 3.8.0
-
within
Determines if a value is within the specified list of values. If the array of arguments itself isnullthen the argument is treated asObject[1]where that single value isnull.- Since:
- 3.0.0-incubating
-
within
public static <V> P<V> within(org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V>... values) Determines if a value is within the specified list of values. If the array of arguments itself isnullthen the argument is treated asObject[1]where that single value isnull.- Since:
- 3.8.0
-
within
Determines if a value is within the specified list of values. Calling this withnullis the same as callingwithin(Object[])usingnull.- Since:
- 3.0.0-incubating
-
within
Determines if a value is within the results of a child traversal resolved at runtime.- Since:
- 4.0.0
-
within
Determines if a value is within the results of child traversals resolved at runtime. Each traversal is evaluated independently and results are combined into a single collection.- Since:
- 4.0.0
-
without
Determines if a value is not within the specified list of values. If the array of arguments itself isnullthen the argument is treated asObject[1]where that single value isnull.- Since:
- 3.0.0-incubating
-
without
public static <V> P<V> without(org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V>... values) Determines if a value is not within the specified list of values. If the array of arguments itself isnullthen the argument is treated asObject[1]where that single value isnull.- Since:
- 3.8.0
-
without
Determines if a value is not within the specified list of values. Calling this withnullis the same as callingwithin(Object[])usingnull.- Since:
- 3.0.0-incubating
-
without
Determines if a value is not within the results of a child traversal resolved at runtime.- Since:
- 4.0.0
-
without
Determines if a value is not within the results of child traversals resolved at runtime. Each traversal is evaluated independently and results are combined into a single collection.- Since:
- 4.0.0
-
typeOf
Determines if a value is of a type denoted byGType.- Since:
- 3.8.0
-
typeOf
Determines if a value is of a type denoted by String key of GlobalTypeCache.- Since:
- 3.8.0
-
typeOf
Sugar method for Java/Groovy embedded cases only, determines if a value is of a type denoted by class.- Since:
- 3.8.0
-
test
Construct an instance ofPfrom aBiPredicate.- Since:
- 3.0.0-incubating
-
not
The opposite of the specifiedP.- Since:
- 3.0.0-incubating
-