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


Java Direction.BOTH属性代码示例

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

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

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

示例6: BaseVertexCentricQuery

/**
 * Construct an empty query
 */
protected BaseVertexCentricQuery() {
    this(new FixedCondition<TitanRelation>(false), Direction.BOTH, new ArrayList<BackendQueryHolder<SliceQuery>>(0),OrderList.NO_ORDER,0);
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:6,代码来源:BaseVertexCentricQuery.java

示例7: StandardEdgeLabelMaker

public StandardEdgeLabelMaker(StandardTitanTx tx, IndexSerializer indexSerializer,
                              final AttributeHandling attributeHandler) {
    super(tx, indexSerializer, attributeHandler);
    unidirectionality = Direction.BOTH;
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:5,代码来源:StandardEdgeLabelMaker.java

示例8: directed

@Override
public StandardEdgeLabelMaker directed() {
    unidirectionality = Direction.BOTH;
    return this;
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:5,代码来源:StandardEdgeLabelMaker.java

示例9: isUnidirected

@Override
public boolean isUnidirected(Direction dir) {
    if (unidirected) return dir==Direction.OUT;
    else return dir==Direction.BOTH;
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:5,代码来源:EdgeLabelDefinition.java

示例10: impliedBy

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


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