public boolean isWrapAround() { // On range can ever wrap return keyRange instanceof Range && ((Range)keyRange).isWrapAround(); }
/** * Whether the range queried by this {@code DataRange} actually wraps around. * * @return whether the range queried by this {@code DataRange} actually wraps around. */ public boolean isWrapAround() { // Only range can ever wrap return keyRange instanceof Range && ((Range<?>)keyRange).isWrapAround(); }
public boolean isWrapAround() { return isWrapAround(left, right); }
/** * Whether the range queried by this {@code DataRange} actually wraps around. * * @return whether the range queried by this {@code DataRange} actually wraps around. */ public boolean isWrapAround() { // Only range can ever wrap return keyRange instanceof Range && ((Range<?>)keyRange).isWrapAround(); }
/** * Whether the range queried by this {@code DataRange} actually wraps around. * * @return whether the range queried by this {@code DataRange} actually wraps around. */ public boolean isWrapAround() { // Only range can ever wrap return keyRange instanceof Range && ((Range<?>)keyRange).isWrapAround(); }
/** * Whether the range queried by this {@code DataRange} actually wraps around. * * @return whether the range queried by this {@code DataRange} actually wraps around. */ public boolean isWrapAround() { // Only range can ever wrap return keyRange instanceof Range && ((Range<?>)keyRange).isWrapAround(); }
public boolean isWrapAround() { return isWrapAround(left, right); }
public boolean isWrapAround() { return isWrapAround(left, right); }
public int compareTo(Range<T> rhs) { /* * If the range represented by the "this" pointer * is a wrap around then it is the smaller one. */ if ( isWrapAround(left, right) ) return -1; if ( isWrapAround(rhs.left, rhs.right) ) return 1; return right.compareTo(rhs.right); }
/** * Note: this class has a natural ordering that is inconsistent with equals */ public int compareTo(Range<T> rhs) { boolean lhsWrap = isWrapAround(left, right); boolean rhsWrap = isWrapAround(rhs.left, rhs.right); // if one of the two wraps, that's the smaller one. if (lhsWrap != rhsWrap) return Boolean.compare(!lhsWrap, !rhsWrap); // otherwise compare by right. return right.compareTo(rhs.right); }
/** * Note: this class has a natural ordering that is inconsistent with equals */ public int compareTo(Range<T> rhs) { boolean lhsWrap = isWrapAround(left, right); boolean rhsWrap = isWrapAround(rhs.left, rhs.right); // if one of the two wraps, that's the smaller one. if (lhsWrap != rhsWrap) return Boolean.compare(!lhsWrap, !rhsWrap); // otherwise compare by right. return right.compareTo(rhs.right); }
/** * Note: this class has a natural ordering that is inconsistent with equals */ public int compareTo(Range<T> rhs) { boolean lhsWrap = isWrapAround(left, right); boolean rhsWrap = isWrapAround(rhs.left, rhs.right); // if one of the two wraps, that's the smaller one. if (lhsWrap != rhsWrap) return Boolean.compare(!lhsWrap, !rhsWrap); // otherwise compare by right. return right.compareTo(rhs.right); }
public List<Range<T>> unwrap() { T minValue = right.minValue(); if (!isWrapAround() || right.equals(minValue)) return Arrays.asList(this); List<Range<T>> unwrapped = new ArrayList<Range<T>>(2); unwrapped.add(new Range<T>(left, minValue)); unwrapped.add(new Range<T>(minValue, right)); return unwrapped; }
public List<Range<T>> unwrap() { @SuppressWarnings("unchecked") T minValue = (T) partitioner.minValue(right.getClass()); if (!isWrapAround() || right.equals(minValue)) return Arrays.asList(this); List<Range<T>> unwrapped = new ArrayList<Range<T>>(2); unwrapped.add(new Range<T>(left, minValue, partitioner)); unwrapped.add(new Range<T>(minValue, right, partitioner)); return unwrapped; }
public List<Range<T>> unwrap() { T minValue = right.minValue(); if (!isWrapAround() || right.equals(minValue)) return Arrays.asList(this); List<Range<T>> unwrapped = new ArrayList<Range<T>>(2); unwrapped.add(new Range<T>(left, minValue)); unwrapped.add(new Range<T>(minValue, right)); return unwrapped; }
public List<Range<T>> unwrap() { T minValue = right.minValue(); if (!isWrapAround() || right.equals(minValue)) return Arrays.asList(this); List<Range<T>> unwrapped = new ArrayList<Range<T>>(2); unwrapped.add(new Range<T>(left, minValue)); unwrapped.add(new Range<T>(minValue, right)); return unwrapped; }
public List<Range<T>> unwrap() { T minValue = right.minValue(); if (!isWrapAround() || right.equals(minValue)) return Arrays.asList(this); List<Range<T>> unwrapped = new ArrayList<Range<T>>(2); unwrapped.add(new Range<T>(left, minValue)); unwrapped.add(new Range<T>(minValue, right)); return unwrapped; }
public void addPendingRange(Range<Token> range, InetAddress address) { if (Range.isWrapAround(range.left, range.right)) { addToMap(range, address, ascendingMapForWrapAround, descendingMapForWrapAround); } else { addToMap(range, address, ascendingMap, descendingMap); } }
public void addPendingRange(Range<Token> range, InetAddress address) { if (Range.isWrapAround(range.left, range.right)) { addToMap(range, address, ascendingMapForWrapAround, descendingMapForWrapAround); } else { addToMap(range, address, ascendingMap, descendingMap); } }
public void addPendingRange(Range<Token> range, InetAddress address) { if (Range.isWrapAround(range.left, range.right)) { addToMap(range, address, ascendingMapForWrapAround, descendingMapForWrapAround); } else { addToMap(range, address, ascendingMap, descendingMap); } }