本文整理汇总了Java中com.tinkerpop.blueprints.Direction.OUT属性的典型用法代码示例。如果您正苦于以下问题:Java Direction.OUT属性的具体用法?Java Direction.OUT怎么用?Java Direction.OUT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.tinkerpop.blueprints.Direction
的用法示例。
在下文中一共展示了Direction.OUT属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getDirection
public Direction getDirection() {
switch(this) {
case PROPERTY_DIR:
case EDGE_OUT_DIR:
return Direction.OUT;
case EDGE_IN_DIR:
return Direction.IN;
default: throw new AssertionError();
}
}
示例5: findRelation
TitanRelation findRelation(TitanTransaction tx) {
TitanVertex v = ((StandardTitanTx)tx).getInternalVertex(outVertexId);
if (v == null || v.isRemoved()) return null;
TitanVertex typeVertex = tx.getVertex(typeId);
if (typeVertex == null) return null;
if (!(typeVertex instanceof RelationType))
throw new IllegalArgumentException("Invalid RelationIdentifier: typeID does not reference a type");
RelationType type = (RelationType)typeVertex;
Iterable<? extends TitanRelation> rels;
if (((RelationType) typeVertex).isEdgeLabel()) {
Direction dir = Direction.OUT;
TitanVertex other = ((StandardTitanTx)tx).getInternalVertex(inVertexId);
if (other==null || other.isRemoved()) return null;
if (((StandardTitanTx)tx).isPartitionedVertex(v) && !((StandardTitanTx)tx).isPartitionedVertex(other)) { //Swap for likely better performance
TitanVertex tmp = other;
other = v;
v = tmp;
dir = Direction.IN;
}
rels = ((VertexCentricQueryBuilder)v.query()).noPartitionRestriction().types((EdgeLabel) type).direction(dir).adjacent(other).titanEdges();
} else {
rels = ((VertexCentricQueryBuilder)v.query()).noPartitionRestriction().types((PropertyKey)type).properties();
}
for (TitanRelation r : rels) {
//Find current or previous relation
if (r.getLongId() == relationId ||
((r instanceof StandardRelation) && ((StandardRelation)r).getPreviousID()==relationId)) return r;
}
return null;
}
示例6: fromPosition
public static Direction fromPosition(int pos) {
switch (pos) {
case 0:
return Direction.OUT;
case 1:
return Direction.IN;
default:
throw new IllegalArgumentException("Invalid position:" + pos);
}
}
示例7: properties
@Override
public Iterable<TitanProperty> properties() {
dir = Direction.OUT;
return (Iterable)getRelations(RelationCategory.PROPERTY);
}
示例8: 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();
}
示例9: isUnidirected
@Override
public boolean isUnidirected(Direction dir) {
return dir==Direction.OUT;
}
示例10: isUnidirected
@Override
public boolean isUnidirected(Direction dir) {
if (unidirected) return dir==Direction.OUT;
else return dir==Direction.BOTH;
}
示例11: isProperDirection
public static boolean isProperDirection(Direction dir) {
return dir==Direction.IN || dir==Direction.OUT;
}