本文整理汇总了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));
}
示例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));
}