当前位置: 首页>>代码示例>>Java>>正文


Java Direction.IN属性代码示例

本文整理汇总了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);
    }
}
 
开发者ID:apache,项目名称:incubator-atlas,代码行数:20,代码来源:TitanObjectFactory.java

示例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();
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:8,代码来源:FaunusVertex.java

示例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();
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:7,代码来源:RelationTypeIndexWrapper.java

示例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();
    }
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:10,代码来源:IDHandler.java

示例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;
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:32,代码来源:RelationIdentifier.java

示例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);
    }
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:12,代码来源:EdgeDirection.java

示例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();
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:6,代码来源:FaunusElement.java

示例8: getVertex

@Override
public TitanVertex getVertex(Direction dir) {
    if (dir!=Direction.IN) throw new UnsupportedOperationException();
    return vertex;
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:5,代码来源:SimpleFaunusEdge.java

示例9: getVertexId

@Override
public long getVertexId(Direction dir) {
    if (dir!=Direction.IN) throw new UnsupportedOperationException();
    return vertex.getLongId();
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:5,代码来源:SimpleFaunusEdge.java

示例10: isProperDirection

public static boolean isProperDirection(Direction dir) {
    return dir==Direction.IN || dir==Direction.OUT;
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:3,代码来源:EdgeDirection.java


注:本文中的com.tinkerpop.blueprints.Direction.IN属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。