@Override public View viewGe(byte[] key) { return BoundedView.viewGe(this, key); }
@Override public View viewGe(byte[] key) { return BoundedView.viewGe(this, key); }
@Override public View viewGe(byte[] key) { return BoundedView.viewGe(this, key); }
@Override public View viewGe(byte[] key) { return BoundedView.viewGe(this, key); }
@Override public View viewGe(byte[] key) { return BoundedView.viewGe(this, key); }
@Override public View viewGe(byte[] key) { return BoundedView.viewGe(this, key); }
/** * Returns a sub-view, backed by this one, whose keys are greater than or * equal to the given key. Ownership of the key instance is transferred, * and so it must not be modified after calling this method. * * <p>The returned view will throw a {@link ViewConstraintException} on an attempt to * insert a key outside its range. * * @throws UnsupportedOperationException if view is unordered * @throws NullPointerException if key is null */ public default View viewGe(byte[] key) { Ordering ordering = getOrdering(); if (ordering == Ordering.ASCENDING) { return BoundedView.viewGe(this, key); } else if (ordering == Ordering.DESCENDING) { return BoundedView.viewGe(viewReverse(), key).viewReverse(); } else { throw new UnsupportedOperationException("Unsupported ordering: " + ordering); } }
/** * Returns a sub-view, backed by this one, whose keys are greater than or * equal to the given key. Ownership of the key instance is transferred, * and so it must not be modified after calling this method. * * <p>The returned view will throw a {@link ViewConstraintException} on an attempt to * insert a key outside its range. * * @throws UnsupportedOperationException if view is unordered * @throws NullPointerException if key is null */ public default View viewGe(byte[] key) { Ordering ordering = getOrdering(); if (ordering == Ordering.ASCENDING) { return BoundedView.viewGe(this, key); } else if (ordering == Ordering.DESCENDING) { return BoundedView.viewGe(viewReverse(), key).viewReverse(); } else { throw new UnsupportedOperationException("Unsupported ordering: " + ordering); } }
/** * Returns a sub-view, backed by this one, whose keys are greater than or * equal to the given key. Ownership of the key instance is transferred, * and so it must not be modified after calling this method. * * <p>The returned view will throw a {@link ViewConstraintException} on an attempt to * insert a key outside its range. * * @throws UnsupportedOperationException if view is unordered * @throws NullPointerException if key is null */ public default View viewGe(byte[] key) { Ordering ordering = getOrdering(); if (ordering == Ordering.ASCENDING) { return BoundedView.viewGe(this, key); } else if (ordering == Ordering.DESCENDING) { return BoundedView.viewGe(viewReverse(), key).viewReverse(); } else { throw new UnsupportedOperationException("Unsupported ordering: " + ordering); } }
@Override public View viewPrefix(byte[] prefix, int trim) { SubView.prefixCheck(prefix, trim); // Note: Slight optimization is possible, by not creating a short-lived view object. // Current implementation is simpler, and optimization seems unnecessary. View view = viewGe(prefix); byte[] end = prefix.clone(); if (increment(end, 0, end.length)) { view = view.viewLt(end); } if (trim > 0) { view = new TrimmedView(view, prefix, trim); } return view; }
@Override public View viewPrefix(byte[] prefix, int trim) { SubView.prefixCheck(prefix, trim); // Note: Slight optimization is possible, by not creating a short-lived view object. // Current implementation is simpler, and optimization seems unnecessary. View view = viewGe(prefix); byte[] end = prefix.clone(); if (increment(end, 0, end.length)) { view = view.viewLt(end); } if (trim > 0) { view = new TrimmedView(view, prefix, trim); } return view; }
@Override public View viewPrefix(byte[] prefix, int trim) { SubView.prefixCheck(prefix, trim); // Note: Slight optimization is possible, by not creating a short-lived view object. // Current implementation is simpler, and optimization seems unnecessary. View view = viewGe(prefix); byte[] end = prefix.clone(); if (increment(end, 0, end.length)) { view = view.viewLt(end); } if (trim > 0) { view = new TrimmedView(view, prefix, trim); } return view; }