本文整理汇总了Java中com.tinkerpop.blueprints.Direction.IN属性的典型用法代码示例。如果您正苦于以下问题:Java Direction.IN属性的具体用法?Java Direction.IN怎么用?Java Direction.IN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.tinkerpop.blueprints.Direction
的用法示例。
在下文中一共展示了Direction.IN属性的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: addEdge
public FaunusEdge addEdge(final Direction direction, final String label, final long otherVertexId) {
if (direction == OUT)
return this.addEdge(new StandardFaunusEdge(this.configuration, getLongId(), otherVertexId, label));
else if (direction == Direction.IN)
return this.addEdge(new StandardFaunusEdge(this.configuration, otherVertexId, getLongId(), label));
else
throw ExceptionFactory.bothIsNotSupported();
}
示例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: 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();
}
示例8: getVertex
@Override
public TitanVertex getVertex(Direction dir) {
if (dir!=Direction.IN) throw new UnsupportedOperationException();
return vertex;
}
示例9: getVertexId
@Override
public long getVertexId(Direction dir) {
if (dir!=Direction.IN) throw new UnsupportedOperationException();
return vertex.getLongId();
}
示例10: isProperDirection
public static boolean isProperDirection(Direction dir) {
return dir==Direction.IN || dir==Direction.OUT;
}