Java Code Examples for com.google.common.collect.ContiguousSet#descendingIterator()

The following examples show how to use com.google.common.collect.ContiguousSet#descendingIterator() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UnboundableCQLStatementIterator.java    From Rhombus with MIT License 5 votes vote down vote up
public UnboundableCQLStatementIterator(Range<Long> shardKeyList, long limit, CObjectOrdering ordering, CQLStatement CQLTemplate, String objectName){
	this.keyRange = shardKeyList;
	ContiguousSet<Long> set = ContiguousSet.create(shardKeyList, DiscreteDomain.longs());
	this.keyIterator = (ordering == CObjectOrdering.ASCENDING) ? set.iterator() : set.descendingIterator();
	this.ordering = ordering;
	this.size = (long)set.size();
	this.limit = limit;
	this.numberRemaining = this.limit;
	this.CQLTemplate = CQLTemplate;
	this.setObjectName(objectName);

}
 
Example 2
Source File: FakeIdRange.java    From Rhombus with MIT License 4 votes vote down vote up
private Iterator<IdInRange> getIterator(CObjectOrdering ordering, Range<Long> range) {
	ContiguousSet<Long> set = ContiguousSet.create(range, DiscreteDomain.longs());
	Iterator<Long> rangeIterator = (ordering == CObjectOrdering.ASCENDING) ? set.iterator() : set.descendingIterator();
	return new IdIterator(rangeIterator);
}