Home | History | Annotate | Download | only in util

Lines Matching refs:upper

44      * The endpoints are {@code [lower, upper]}; that
46 * to {@code upper}.
50 * @param upper The upper endpoint (inclusive)
52 * @throws NullPointerException if {@code lower} or {@code upper} is {@code null}
54 public Range(final T lower, final T upper) {
56 mUpper = checkNotNull(upper, "upper must not be null");
58 if (lower.compareTo(upper) > 0) {
59 throw new IllegalArgumentException("lower must be less than or equal to upper");
67 * The endpoints are {@code [lower, upper]}; that
69 * to {@code upper}.
73 * @param upper The upper endpoint (inclusive)
75 * @throws NullPointerException if {@code lower} or {@code upper} is {@code null}
77 public static <T extends Comparable<? super T>> Range<T> create(final T lower, final T upper) {
78 return new Range<T>(lower, upper);
91 * Get the upper endpoint.
103 * the lower endpoint <i>and</i> {@code <=} the upper endpoint (using the {@link Comparable}
143 * <p>A range is considered equal if and only if both the lower and upper endpoints
167 * else the upper endpoint is returned. Comparisons are performed using the
225 * specified by {@code [lower, upper]}.
230 * @param upper a non-{@code null} {@code T} reference
233 * @throws NullPointerException if {@code lower} or {@code upper} was {@code null}
236 public Range<T> intersect(T lower, T upper) {
238 checkNotNull(upper, "upper must not be null");
241 int cmpUpper = upper.compareTo(mUpper);
244 // [lower, upper] includes this
249 cmpUpper >= 0 ? mUpper : upper);
293 * the inclusive range specified by {@code [lower, upper]}.
298 * @param upper a non-{@code null} {@code T} reference
302 * upper} was {@code null}
304 public Range<T> extend(T lower, T upper) {
306 checkNotNull(upper, "upper must not be null");
309 int cmpUpper = upper.compareTo(mUpper);
317 cmpUpper <= 0 ? mUpper : upper);
339 * Return the range as a string representation {@code "[lower, upper]"}.