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);
 }
示例#2
0
 /** Returns {@code true} if this range has an upper endpoint. */
 public boolean hasUpperBound() {
   return upperBound != Cut.aboveAll();
 }
示例#3
0
 /** 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());
 }
示例#4
0
 /** 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());
 }
示例#5
0
 /** 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());
 }