Class P<V>
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.process.traversal.P<V>
-
- All Implemented Interfaces:
Serializable,Cloneable,Predicate<V>
public class P<V> extends Object implements Predicate<V>, Serializable, Cloneable
PredefinedPredicatevalues that can be used to define filters tohas()andwhere().- Author:
- Marko A. Rodriguez (http://markorodriguez.com), Stephen Mallette (http://stephen.genoprime.com)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected PBiPredicate<V,V>biPredicateprotected Collection<V>literalsprotected Map<String,V>variables
-
Constructor Summary
Constructors Modifier Constructor Description protectedP(PBiPredicate<V,V> biPredicate, Collection<V> literals, Map<String,V> variables, boolean isCollection)P(PBiPredicate<V,V> biPredicate, org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> value)P(PBiPredicate<V,V> biPredicate, V value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description P<V>and(Predicate<? super V> predicate)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.static <V> P<V>between(V first, V second)Determines if a value is within (inclusive) of the range of the two specified values.P<V>clone()static <V> P<V>eq(org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> value)Determines if values are equal.static <V> P<V>eq(V value)Determines if values are equal.booleanequals(Object other)PBiPredicate<V,V>getBiPredicate()Set<org.apache.tinkerpop.gremlin.process.traversal.step.GValue<?>>getGValues()StringgetPredicateName()Get the name of the predicateVgetValue()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>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>gte(V value)Determines if a value is greater than or equal to another.inthashCode()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.booleanisParameterized()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>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>lte(V value)Determines if a value is less than or equal to another.P<V>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>neq(V value)Determines if values are not equal.static <V> P<V>not(P<V> predicate)The opposite of the specifiedP.P<V>or(Predicate<? super V> predicate)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.voidsetValue(V value)static Ptest(PBiPredicate biPredicate, Object value)Construct an instance ofPfrom aBiPredicate.booleantest(V testValue)StringtoString()static <V> P<V>typeOf(Class<?> value)Sugar method for Java/Groovy embedded cases only, determines if a value is of a type denoted by class.static <V> P<V>typeOf(String value)Determines if a value is of a type denoted by String key of GlobalTypeCache.static <V> P<V>typeOf(GType value)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>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>without(V... values)Determines if a value is not within the specified list of values.
-
-
-
Field Detail
-
biPredicate
protected PBiPredicate<V,V> biPredicate
-
literals
protected Collection<V> literals
-
-
Constructor Detail
-
P
public P(PBiPredicate<V,V> biPredicate, V value)
-
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)
-
-
Method Detail
-
getBiPredicate
public PBiPredicate<V,V> getBiPredicate()
-
getPredicateName
public String getPredicateName()
Get the name of the predicate
-
getValue
public V getValue()
Gets the current value to be passed to the predicate for testing.
-
setValue
public void setValue(V value)
-
isParameterized
public boolean isParameterized()
-
getGValues
public Set<org.apache.tinkerpop.gremlin.process.traversal.step.GValue<?>> getGValues()
-
eq
public static <V> P<V> eq(V value)
Determines if values are equal.- Since:
- 3.0.0-incubating
-
eq
public static <V> P<V> eq(org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> value)
Determines if values are equal.- Since:
- 3.8.0
-
neq
public static <V> P<V> neq(V value)
Determines if values are not equal.- Since:
- 3.0.0-incubating
-
neq
public static <V> P<V> neq(org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> value)
Determines if values are not equal.- Since:
- 3.8.0
-
lt
public static <V> P<V> lt(V value)
Determines if a value is less than another.- Since:
- 3.0.0-incubating
-
lt
public static <V> P<V> lt(org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> value)
Determines if a value is less than another.- Since:
- 3.8.0
-
lte
public static <V> P<V> lte(V value)
Determines if a value is less than or equal to another.- Since:
- 3.0.0-incubating
-
lte
public 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.- Since:
- 3.8.0
-
gt
public static <V> P<V> gt(V value)
Determines if a value is greater than another.- Since:
- 3.0.0-incubating
-
gt
public static <V> P<V> gt(org.apache.tinkerpop.gremlin.process.traversal.step.GValue<V> value)
Determines if a value is greater than another.- Since:
- 3.8.0
-
gte
public static <V> P<V> gte(V value)
Determines if a value is greater than or equal to another.- Since:
- 3.0.0-incubating
-
gte
public 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.- Since:
- 3.8.0
-
inside
public static <V> P<V> inside(V first, V second)
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
public 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.- 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
public static <V> P<V> between(V first, V second)
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
public static <V> P<V> within(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.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
public static <V> P<V> within(Collection<V> value)
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
-
without
public static <V> P<V> without(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.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
public static <V> P<V> without(Collection<V> value)
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
-
typeOf
public static <V> P<V> typeOf(GType value)
Determines if a value is of a type denoted byGType.- Since:
- 3.8.0
-
typeOf
public static <V> P<V> typeOf(String value)
Determines if a value is of a type denoted by String key of GlobalTypeCache.- Since:
- 3.8.0
-
typeOf
public static <V> P<V> typeOf(Class<?> value)
Sugar method for Java/Groovy embedded cases only, determines if a value is of a type denoted by class.- Since:
- 3.8.0
-
test
public static P test(PBiPredicate biPredicate, Object value)
Construct an instance ofPfrom aBiPredicate.- Since:
- 3.0.0-incubating
-
-