static { List<Cut<Integer>> cutsToTest = Lists.newArrayList(); for (int i = MIN_BOUND - 1; i <= MAX_BOUND + 1; i++) { cutsToTest.add(Cut.belowValue(i)); cutsToTest.add(Cut.aboveValue(i)); } cutsToTest.add(Cut.<Integer>aboveAll()); cutsToTest.add(Cut.<Integer>belowAll()); CUTS_TO_TEST = ImmutableList.copyOf(cutsToTest); }
/** Returns {@code true} if this range has an upper endpoint. */ public boolean hasUpperBound() { return upperBound != Cut.aboveAll(); }
/** Returns a range that contains every value of type {@code C}. */ public static <C extends Comparable<?>> Range<C> all() { return create(Cut.<C>belowAll(), Cut.<C>aboveAll()); }
/** Returns a range that contains all values greater than or equal to {@code endpoint}. */ public static <C extends Comparable<?>> Range<C> atLeast(C endpoint) { return create(Cut.belowValue(endpoint), Cut.<C>aboveAll()); }
/** Returns a range that contains all values strictly greater than {@code endpoint}. */ public static <C extends Comparable<?>> Range<C> greaterThan(C endpoint) { return create(Cut.aboveValue(endpoint), Cut.<C>aboveAll()); }