本文整理汇总了Java中com.tinkerpop.blueprints.Direction.BOTH属性的典型用法代码示例。如果您正苦于以下问题:Java Direction.BOTH属性的具体用法?Java Direction.BOTH怎么用?Java Direction.BOTH使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.tinkerpop.blueprints.Direction
的用法示例。
在下文中一共展示了Direction.BOTH属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDirection
/**
* Retrieves the titan direction corresponding to the given
* AtlasEdgeDirection.
*
* @param dir
* @return
*/
public static Direction createDirection(AtlasEdgeDirection dir) {
switch(dir) {
case IN:
return Direction.IN;
case OUT:
return Direction.OUT;
case BOTH:
return Direction.BOTH;
default:
throw new RuntimeException("Unrecognized direction: " + dir);
}
}
示例2: evaluate
@Override
public boolean evaluate(E element) {
if (direction==Direction.BOTH) return true;
if (element instanceof CacheEdge) {
return direction==((CacheEdge)element).getVertexCentricDirection();
} else if (element instanceof TitanEdge) {
return ((TitanEdge)element).getVertex(direction).equals(baseVertex);
} else if (element instanceof TitanProperty) {
return direction==Direction.OUT;
}
return false;
}
示例3: getDirection
@Override
public Direction getDirection() {
if (type.isUnidirected(Direction.BOTH)) return Direction.BOTH;
else if (type.isUnidirected(Direction.OUT)) return Direction.OUT;
else if (type.isUnidirected(Direction.IN)) return Direction.IN;
throw new AssertionError();
}
示例4: getRelations
protected Iterable<FaunusRelation> getRelations(FaunusElement element, RelationCategory returnType) {
FaunusSchemaManager typeManager = element.getTypeManager();
final And<TitanRelation> condition = getCondition(element,returnType);
if (condition==null) return Collections.EMPTY_LIST;
Iterable<FaunusRelation> result=null;
for (Direction direction : Direction.proper) {
if (dir!=direction && dir!=Direction.BOTH) continue;
SetMultimap<FaunusRelationType, FaunusRelation> adjacency = element.getAdjacency(direction);
if (types.length==0) {
if (result==null) result=adjacency.values();
else result = Iterables.concat(result,adjacency.values());
} else {
for (String type : types) {
FaunusRelationType rt = typeManager.getRelationType(type);
if (rt==null) continue;
Iterable<FaunusRelation> rels;
if (rt.isPropertyKey() && ((FaunusPropertyKey)rt).isImplicit()) {
FaunusPropertyKey key = (FaunusPropertyKey)rt;
Object value = key.computeImplicit(element);
if (value!=null)
rels = Lists.newArrayList((FaunusRelation)new SimpleFaunusProperty(key,value));
else rels = Collections.EMPTY_LIST;
} else {
rels = adjacency.get(rt);
}
if (result==null) result=rels;
else result = Iterables.concat(result,rels);
}
}
}
result = new FilterIterable(condition, element, result, dir);
//Order
if (!orders.isEmpty()) {
ArrayList<FaunusRelation> allRels = Lists.newArrayList(result);
Collections.sort(allRels,orders);
result = new RemoveOriginalIterable(allRels, element, dir);
}
//Limit
if (limit!= Query.NO_LIMIT) {
result = Iterables.limit(result,limit);
}
return result;
}
示例5: initializeAdjacency
protected void initializeAdjacency(Direction dir) {
if ((dir==Direction.OUT || dir==Direction.BOTH) && this.outAdjacency == EMPTY_ADJACENCY)
outAdjacency = HashMultimap.create();
if ((dir==Direction.IN || dir==Direction.BOTH) && this.inAdjacency == EMPTY_ADJACENCY)
inAdjacency = HashMultimap.create();
}
示例6: BaseVertexCentricQuery
/**
* Construct an empty query
*/
protected BaseVertexCentricQuery() {
this(new FixedCondition<TitanRelation>(false), Direction.BOTH, new ArrayList<BackendQueryHolder<SliceQuery>>(0),OrderList.NO_ORDER,0);
}
示例7: StandardEdgeLabelMaker
public StandardEdgeLabelMaker(StandardTitanTx tx, IndexSerializer indexSerializer,
final AttributeHandling attributeHandler) {
super(tx, indexSerializer, attributeHandler);
unidirectionality = Direction.BOTH;
}
示例8: directed
@Override
public StandardEdgeLabelMaker directed() {
unidirectionality = Direction.BOTH;
return this;
}
示例9: isUnidirected
@Override
public boolean isUnidirected(Direction dir) {
if (unidirected) return dir==Direction.OUT;
else return dir==Direction.BOTH;
}
示例10: impliedBy
public static boolean impliedBy(Direction sub, Direction sup) {
return sup==sub || sup==Direction.BOTH;
}