本文整理汇总了Java中com.tinkerpop.blueprints.Predicate类的典型用法代码示例。如果您正苦于以下问题:Java Predicate类的具体用法?Java Predicate怎么用?Java Predicate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Predicate类属于com.tinkerpop.blueprints包,在下文中一共展示了Predicate类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: has
import com.tinkerpop.blueprints.Predicate; //导入依赖的package包/类
@Override
public GraphQuery has(String key, Predicate predicate, Object value) {
if (predicate.toString().equals("EQUAL"))
return has(key, value);
else if (predicate.toString().equals("NOT_EQUAL"))
return hasNot(key, value);
else if (predicate.toString().equals("GREATER_THAN"))
queryBuilder = queryBuilder.greaterThan(key, value);
else if (predicate.toString().equals("LESS_THAN"))
queryBuilder = queryBuilder.lessThan(key, value);
else if (predicate.toString().equals("GREATER_THAN_EQUAL"))
queryBuilder = queryBuilder.greaterThanEq(key, value);
else if (predicate.toString().equals("LESS_THAN_EQUAL"))
queryBuilder = queryBuilder.lessThanEq(key, value);
else if (predicate.toString().equals("IN"))
queryBuilder = queryBuilder.in(key, (Collection<Object>)value);
else if(predicate.toString().equals("NOT_IN"))
queryBuilder = queryBuilder.notIn(key, (Collection<Object>)value);
else
throw new UnsupportedOperationException("Predicate with type " + predicate + " is not supported.");
return this;
}
开发者ID:calrissian,项目名称:accumulo-recipes,代码行数:24,代码来源:EntityGraphQuery.java
示例2: has
import com.tinkerpop.blueprints.Predicate; //导入依赖的package包/类
@Override
public VertexQuery has(String key, Predicate predicate, Object value) {
if (predicate.toString().equals("EQUAL"))
return has(key, value);
else if (predicate.toString().equals("NOT_EQUAL"))
return hasNot(key, value);
else if (predicate.toString().equals("GREATER_THAN"))
queryBuilder = queryBuilder.greaterThan(key, value);
else if (predicate.toString().equals("LESS_THAN"))
queryBuilder = queryBuilder.lessThan(key, value);
else if (predicate.toString().equals("GREATER_THAN_EQUAL"))
queryBuilder = queryBuilder.greaterThanEq(key, value);
else if (predicate.toString().equals("LESS_THAN_EQUAL"))
queryBuilder = queryBuilder.lessThanEq(key, value);
else if (predicate.toString().equals("IN"))
queryBuilder = queryBuilder.in(key, (Collection<Object>)value);
else if (predicate.toString().equals("NOT_IN"))
queryBuilder = queryBuilder.notIn(key, (Collection<Object>)value);
else
throw new UnsupportedOperationException("Predicate with type " + predicate + " is not supported.");
return this;
}
开发者ID:calrissian,项目名称:accumulo-recipes,代码行数:24,代码来源:EntityVertexQuery.java
示例3: mapPredicate
import com.tinkerpop.blueprints.Predicate; //导入依赖的package包/类
public static Predicate mapPredicate(final T t) {
if (t.equals(T.eq))
return Compare.EQUAL;
else if (t.equals(T.neq))
return Compare.NOT_EQUAL;
else if (t.equals(T.lt))
return Compare.LESS_THAN;
else if (t.equals(T.lte))
return Compare.LESS_THAN_EQUAL;
else if (t.equals(T.gt))
return Compare.GREATER_THAN;
else if (t.equals(T.gte))
return Compare.GREATER_THAN_EQUAL;
else if (t.equals(T.in))
return Contains.IN;
else if (t.equals(T.notin))
return Contains.NOT_IN;
else
throw new IllegalArgumentException(t.toString() + " is an unknown filter type");
}
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:21,代码来源:Tokens.java
示例4: toVertexiumPredicate
import com.tinkerpop.blueprints.Predicate; //导入依赖的package包/类
protected org.vertexium.query.Predicate toVertexiumPredicate(Predicate predicate) {
if (predicate.equals(com.tinkerpop.blueprints.Compare.EQUAL)) {
return org.vertexium.query.Compare.EQUAL;
}
if (predicate.equals(com.tinkerpop.blueprints.Compare.NOT_EQUAL)) {
return org.vertexium.query.Compare.NOT_EQUAL;
}
if (predicate.equals(com.tinkerpop.blueprints.Compare.GREATER_THAN)) {
return org.vertexium.query.Compare.GREATER_THAN;
}
if (predicate.equals(com.tinkerpop.blueprints.Compare.GREATER_THAN_EQUAL)) {
return org.vertexium.query.Compare.GREATER_THAN_EQUAL;
}
if (predicate.equals(com.tinkerpop.blueprints.Compare.LESS_THAN)) {
return org.vertexium.query.Compare.LESS_THAN;
}
if (predicate.equals(com.tinkerpop.blueprints.Compare.LESS_THAN_EQUAL)) {
return org.vertexium.query.Compare.LESS_THAN_EQUAL;
}
if (predicate.equals(com.tinkerpop.blueprints.Contains.IN)) {
return org.vertexium.query.Contains.IN;
}
if (predicate.equals(com.tinkerpop.blueprints.Contains.NOT_IN)) {
return org.vertexium.query.Contains.NOT_IN;
}
throw new VertexiumException("Could not convert Blueprints predicate '" + predicate + "' to Vertexium predicate");
}
开发者ID:visallo,项目名称:vertexium,代码行数:30,代码来源:VertexiumBlueprintsQuery.java
示例5: has
import com.tinkerpop.blueprints.Predicate; //导入依赖的package包/类
@Override
public GraphQuery has(String key, Predicate predicate, Object value) {
org.vertexium.query.Predicate vertexiumPredicate = toVertexiumPredicate(predicate);
this.q.has(key, vertexiumPredicate, value);
hasFilter = true;
return this;
}
开发者ID:visallo,项目名称:vertexium,代码行数:8,代码来源:VertexiumBlueprintsGraphQuery.java
示例6: has
import com.tinkerpop.blueprints.Predicate; //导入依赖的package包/类
public Traversal has(String key, Predicate predicate, Object value) {
if(value instanceof Enum) {
value = value.toString();
}
pipeline().has(key, predicate, value);
return this;
}
开发者ID:BrynCooke,项目名称:totorom,代码行数:8,代码来源:TraversalBase.java
示例7: has
import com.tinkerpop.blueprints.Predicate; //导入依赖的package包/类
public void has(String key, Predicate predicate, Object value) {
if (predicate == null) {
throw new NullPointerException("null predicate");
}
if (isPredicateSupported(predicate)) {
addFilter(filters, key, new OperatorAndValue(predicate, value));
} else {
throw new IllegalArgumentException("predicate not supported: " + predicate);
}
}
开发者ID:mikesname,项目名称:blueprints-sql-graph,代码行数:12,代码来源:QueryFilters.java
示例8: has
import com.tinkerpop.blueprints.Predicate; //导入依赖的package包/类
/**
* Add an IdFilterPipe, LabelFilterPipe, or PropertyFilterPipe to the end of the Pipeline.
* If the incoming element has the provided key/value as check with .equals(), then let the element pass.
* If the key is id or label, then use respect id or label filtering.
*
* @param key the property key to check
* @param predicate the comparison to use
* @param value the object to filter on
* @return the extended Pipeline
*/
public GremlinPipeline<S, ? extends Element> has(final String key, final Predicate predicate, final Object value) {
if (key.equals(Tokens.ID)) {
return this.add(new IdFilterPipe(predicate, value));
} else if (key.equals(Tokens.LABEL)) {
return this.add(new LabelFilterPipe(predicate, value));
} else {
final Pipe pipe = new PropertyFilterPipe(key, predicate, value);
return this.doQueryOptimization ? GremlinFluentUtility.optimizePipelineForQuery(this, pipe) : this.add(pipe);
}
}
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:21,代码来源:GremlinPipeline.java
示例9: has
import com.tinkerpop.blueprints.Predicate; //导入依赖的package包/类
public ArangoDBQuery has(String key, Predicate prdct, Object value) {
if (prdct instanceof com.tinkerpop.blueprints.Compare) {
com.tinkerpop.blueprints.Compare compare = (com.tinkerpop.blueprints.Compare) prdct;
hasCompare(key, value, compare);
} else if (prdct instanceof com.tinkerpop.blueprints.Contains) {
com.tinkerpop.blueprints.Contains contains = (com.tinkerpop.blueprints.Contains) prdct;
hasContains(key, contains, value);
}
return this;
}
开发者ID:arangodb,项目名称:blueprints-arangodb-graph,代码行数:11,代码来源:ArangoDBQuery.java
示例10: has
import com.tinkerpop.blueprints.Predicate; //导入依赖的package包/类
@Override
public QueryBuilder has(String key, Predicate predicate, Object value) {
super.has(key, predicate, value);
return this;
}
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:6,代码来源:FulgoraBuilder.java
示例11: has
import com.tinkerpop.blueprints.Predicate; //导入依赖的package包/类
@Override
public Q has(String key, Predicate predicate, Object value) {
return addConstraint(key, TitanPredicate.Converter.convert(predicate), value);
}
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:5,代码来源:BaseVertexCentricQueryBuilder.java
示例12: has
import com.tinkerpop.blueprints.Predicate; //导入依赖的package包/类
@Override
public Q has(PropertyKey key, Predicate predicate, Object value);
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:3,代码来源:OLAPQueryBuilder.java
示例13: has
import com.tinkerpop.blueprints.Predicate; //导入依赖的package包/类
@Override
public EdgeTraversal has(String key, Predicate predicate, Object value) {
return (EdgeTraversal) super.has(key, predicate, value);
}
开发者ID:BrynCooke,项目名称:totorom,代码行数:5,代码来源:EdgeTraversalImpl.java
示例14: has
import com.tinkerpop.blueprints.Predicate; //导入依赖的package包/类
@Override
public VertexTraversal has(String key, Predicate predicate, Object value) {
return (VertexTraversal) super.has(key, predicate, value);
}
开发者ID:BrynCooke,项目名称:totorom,代码行数:5,代码来源:VertexTraversalImpl.java
示例15: has
import com.tinkerpop.blueprints.Predicate; //导入依赖的package包/类
public VertexTraversal has(String key, Predicate predicate, Object value) {
return delegate().has(key, predicate, value);
}
开发者ID:BrynCooke,项目名称:totorom,代码行数:4,代码来源:GlobalVertexTraversal.java
示例16: isPredicateSupported
import com.tinkerpop.blueprints.Predicate; //导入依赖的package包/类
private boolean isPredicateSupported(Predicate p) {
return p instanceof CustomPredicates || p instanceof Query.Compare || p instanceof com.tinkerpop.blueprints.Compare
|| p instanceof Contains;
}
开发者ID:mikesname,项目名称:blueprints-sql-graph,代码行数:5,代码来源:QueryFilters.java
示例17: OperatorAndValue
import com.tinkerpop.blueprints.Predicate; //导入依赖的package包/类
OperatorAndValue(Predicate operator, Object object) {
this.operator = operator;
this.object = object;
}
开发者ID:mikesname,项目名称:blueprints-sql-graph,代码行数:5,代码来源:QueryFilters.java
示例18: has
import com.tinkerpop.blueprints.Predicate; //导入依赖的package包/类
@Override
public SqlGraphQuery has(String key, Predicate predicate, Object value) {
filters.has(key, predicate, value);
return this;
}
开发者ID:mikesname,项目名称:blueprints-sql-graph,代码行数:6,代码来源:SqlGraphQuery.java
示例19: has
import com.tinkerpop.blueprints.Predicate; //导入依赖的package包/类
@Override
public SqlVertexQuery has(String key, Predicate predicate, Object value) {
filters.has(key, predicate, value);
return this;
}
开发者ID:mikesname,项目名称:blueprints-sql-graph,代码行数:6,代码来源:SqlVertexQuery.java
示例20: has
import com.tinkerpop.blueprints.Predicate; //导入依赖的package包/类
public Query has(final String key, final Predicate predicate, final Object value) {
this.hasContainers.add(new HasContainer(key, predicate, value));
return this;
}
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:5,代码来源:DefaultQuery.java
注:本文中的com.tinkerpop.blueprints.Predicate类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论