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


Java PointInterval类代码示例

本文整理汇总了Java中com.thinkaurelius.titan.util.datastructures.PointInterval的典型用法代码示例。如果您正苦于以下问题:Java PointInterval类的具体用法?Java PointInterval怎么用?Java PointInterval使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PointInterval类属于com.thinkaurelius.titan.util.datastructures包,在下文中一共展示了PointInterval类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: constructSliceQueries

import com.thinkaurelius.titan.util.datastructures.PointInterval; //导入依赖的package包/类
private void constructSliceQueries(PropertyKey[] extendedSortKey, EdgeSerializer.TypedInterval[] sortKeyConstraints,
                                   int position,
                                   InternalRelationType bestCandidate, Direction direction,
                                   Map<RelationType,Interval> intervalConstraints, int sliceLimit,
                                   boolean isIntervalFittedConditions, boolean bestCandidateSupportsOrder,
                                   List<BackendQueryHolder<SliceQuery>> queries) {
    if (position<extendedSortKey.length) {
        PropertyKey keyType = extendedSortKey[position];
        Interval interval = intervalConstraints.get(keyType);
        if (interval!=null) {
            sortKeyConstraints[position]=new EdgeSerializer.TypedInterval(keyType,interval);
            position++;
        }
        if (interval!=null && interval.isPoints()) {
            //Keep invoking recursively to see if we can satisfy more constraints...
            for (Object point : interval.getPoints()) {
                EdgeSerializer.TypedInterval[] clonedSKC = Arrays.copyOf(sortKeyConstraints,sortKeyConstraints.length);
                clonedSKC[position-1]=new EdgeSerializer.TypedInterval(keyType,new PointInterval(point));
                constructSliceQueries(extendedSortKey, clonedSKC, position,
                        bestCandidate, direction, intervalConstraints, sliceLimit,
                        isIntervalFittedConditions, bestCandidateSupportsOrder, queries);
            }
            return;
        }
    }
    //...otherwise this is it and we can construct the slicequery

    boolean isFitted = isIntervalFittedConditions && position==intervalConstraints.size();
    if (isFitted && position>0) {
        //If the last interval is open ended toward the larger values, then its not fitted because we need to
        //filter out NULL values which are serialized with -1 (largest value) byte up front.
        EdgeSerializer.TypedInterval lastInterval = sortKeyConstraints[position-1];
        if (!lastInterval.interval.isPoints() && lastInterval.interval.getEnd()==null) isFitted=false;
    }
    EdgeSerializer serializer = tx.getEdgeSerializer();
    SliceQuery q = serializer.getQuery(bestCandidate, direction, sortKeyConstraints);
    q.setLimit(computeLimit(intervalConstraints.size()-position, sliceLimit));
    queries.add(new BackendQueryHolder<SliceQuery>(q, isFitted, bestCandidateSupportsOrder));
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:40,代码来源:BasicVertexCentricQueryBuilder.java

示例2: constructSliceQueries

import com.thinkaurelius.titan.util.datastructures.PointInterval; //导入依赖的package包/类
private void constructSliceQueries(RelationType[] extendedSortKey, EdgeSerializer.TypedInterval[] sortKeyConstraints,
                                   int position,
                                   InternalRelationType bestCandidate, Direction direction,
                                   Map<RelationType,Interval> intervalConstraints, int sliceLimit,
                                   boolean isIntervalFittedConditions, boolean bestCandidateSupportsOrder,
                                   List<BackendQueryHolder<SliceQuery>> queries) {
    if (position<extendedSortKey.length) {
        RelationType keyType = extendedSortKey[position];
        Interval interval = intervalConstraints.get(keyType);
        if (interval!=null) {
            sortKeyConstraints[position]=new EdgeSerializer.TypedInterval((InternalRelationType) keyType,interval);
            position++;
        }
        if (interval!=null && interval.isPoints()) {
            //Keep invoking recursively to see if we can satisfy more constraints...
            for (Object point : interval.getPoints()) {
                EdgeSerializer.TypedInterval[] clonedSKC = Arrays.copyOf(sortKeyConstraints,sortKeyConstraints.length);
                clonedSKC[position-1]=new EdgeSerializer.TypedInterval((InternalRelationType) keyType,new PointInterval(point));
                constructSliceQueries(extendedSortKey, clonedSKC, position,
                        bestCandidate, direction, intervalConstraints, sliceLimit,
                        isIntervalFittedConditions, bestCandidateSupportsOrder, queries);
            }
            return;
        }
    }
    //...otherwise this is it and we can construct the slicequery

    boolean isFitted = isIntervalFittedConditions && position==intervalConstraints.size();
    if (isFitted && position>0) {
        //If the last interval is open ended toward the larger values, then its not fitted because we need to
        //filter out NULL values which are serialized with -1 (largest value) byte up front.
        EdgeSerializer.TypedInterval lastInterval = sortKeyConstraints[position-1];
        if (!lastInterval.interval.isPoints() && lastInterval.interval.getEnd()==null) isFitted=false;
    }
    EdgeSerializer serializer = tx.getEdgeSerializer();
    SliceQuery q = serializer.getQuery(bestCandidate, direction, sortKeyConstraints);
    q.setLimit(computeLimit(intervalConstraints.size()-position, sliceLimit));
    queries.add(new BackendQueryHolder<SliceQuery>(q, isFitted, bestCandidateSupportsOrder, null));
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:40,代码来源:BasicVertexCentricQueryBuilder.java


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