public RangeTombstone search(Clustering name) { int idx = searchInternal(name, 0, size); return idx < 0 ? null : rangeTombstone(idx); }
public RangeTombstone search(Clustering name) { int idx = searchInternal(name, 0, size); return idx < 0 ? null : rangeTombstone(idx); }
public RangeTombstone search(Composite name) { int idx = searchInternal(name, 0); return idx < 0 ? null : rangeTombstone(idx); }
public RangeTombstone search(Clustering name) { int idx = searchInternal(name, 0, size); return idx < 0 ? null : rangeTombstone(idx); }
public RangeTombstone search(Clustering name) { int idx = searchInternal(name, 0, size); return idx < 0 ? null : rangeTombstone(idx); }
public Iterator<RangeTombstone> iterator(Composite from, Composite till) { int startIdx = from.isEmpty() ? 0 : searchInternal(from, 0); final int start = startIdx < 0 ? -startIdx-1 : startIdx; if (start >= size) return Iterators.<RangeTombstone>emptyIterator(); int finishIdx = till.isEmpty() ? size : searchInternal(till, start); // if stopIdx is the first range after 'till' we care only until the previous range final int finish = finishIdx < 0 ? -finishIdx-2 : finishIdx; // Note: the following is true because we know 'from' is before 'till' in sorted order. if (start > finish) return Iterators.<RangeTombstone>emptyIterator(); else if (start == finish) return Iterators.<RangeTombstone>singletonIterator(rangeTombstone(start)); return new AbstractIterator<RangeTombstone>() { private int idx = start; protected RangeTombstone computeNext() { if (idx >= size || idx > finish) return endOfData(); return rangeTombstone(idx++); } }; }