Ejemplo n.º 1
0
 /**
  * Returns a sub-view, backed by this one, whose keys are less 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 viewLe(byte[] key) {
   Ordering ordering = getOrdering();
   if (ordering == Ordering.ASCENDING) {
     return BoundedView.viewLe(this, key);
   } else if (ordering == Ordering.DESCENDING) {
     return BoundedView.viewLe(viewReverse(), key).viewReverse();
   } else {
     throw new UnsupportedOperationException("Unsupported ordering: " + ordering);
   }
 }