Lines Matching refs:ORDERING
38 private static final Ordering<Integer> ORDERING = Ordering.natural().nullsFirst();
46 GeneralRange<Integer> range = GeneralRange.range(ORDERING, 4, lboundType, 2, uboundType);
56 GeneralRange.range(ORDERING, i, OPEN, i, OPEN);
64 GeneralRange<Integer> range = GeneralRange.range(ORDERING, i, CLOSED, i, OPEN);
73 GeneralRange<Integer> range = GeneralRange.range(ORDERING, i, OPEN, i, CLOSED);
82 GeneralRange<Integer> range = GeneralRange.range(ORDERING, i, CLOSED, i, CLOSED);
90 GeneralRange<Integer> range = GeneralRange.range(ORDERING, 3, CLOSED, 3, CLOSED);
92 assertEquals(ORDERING.compare(i, 3) == 0, range.contains(i));
98 GeneralRange<Integer> range = GeneralRange.downTo(ORDERING, 3, lBoundType);
100 assertEquals(ORDERING.compare(i, 3) > 0
101 || (ORDERING.compare(i, 3) == 0 && lBoundType == CLOSED), range.contains(i));
102 assertEquals(ORDERING.compare(i, 3) < 0
103 || (ORDERING.compare(i, 3) == 0 && lBoundType == OPEN), range.tooLow(i));
111 GeneralRange<Integer> range = GeneralRange.upTo(ORDERING, 3, lBoundType);
113 assertEquals(ORDERING.compare(i, 3) < 0
114 || (ORDERING.compare(i, 3) == 0 && lBoundType == CLOSED), range.contains(i));
115 assertEquals(ORDERING.compare(i, 3) > 0
116 || (ORDERING.compare(i, 3) == 0 && lBoundType == OPEN), range.tooHigh(i));
126 GeneralRange<Integer> gRange = GeneralRange.range(ORDERING, 2, lboundType, 4, uboundType);
135 GeneralRange<Integer> range = GeneralRange.range(ORDERING, 2, CLOSED, 4, OPEN);
136 assertEquals(GeneralRange.range(ORDERING, 2, OPEN, 4, OPEN),
137 range.intersect(GeneralRange.range(ORDERING, 2, OPEN, 4, CLOSED)));
141 GeneralRange<Integer> range = GeneralRange.range(ORDERING, 2, CLOSED, 4, OPEN);
143 assertEquals(GeneralRange.range(ORDERING, 2, CLOSED, 4, OPEN),
144 range.intersect(GeneralRange.range(ORDERING, null, OPEN, 5, CLOSED)));
146 assertEquals(GeneralRange.range(ORDERING, 2, OPEN, 4, OPEN),
147 range.intersect(GeneralRange.range(ORDERING, 2, OPEN, 5, CLOSED)));
149 assertEquals(GeneralRange.range(ORDERING, 2, CLOSED, 4, OPEN),
150 range.intersect(GeneralRange.range(ORDERING, 1, OPEN, 4, OPEN)));
154 GeneralRange<Integer> range = GeneralRange.range(ORDERING, 2, OPEN, 4, OPEN);
155 assertEquals(GeneralRange.range(ORDERING, 3, CLOSED, 4, OPEN),
156 range.intersect(GeneralRange.range(ORDERING, 3, CLOSED, 4, CLOSED)));
160 GeneralRange<Integer> range = GeneralRange.range(ORDERING, 2, OPEN, 4, CLOSED);
161 assertEquals(GeneralRange.range(ORDERING, 3, CLOSED, 4, CLOSED),
162 range.intersect(GeneralRange.range(ORDERING, 3, CLOSED, 5, CLOSED)));
163 assertEquals(GeneralRange.range(ORDERING, 2, OPEN, 3, OPEN),
164 range.intersect(GeneralRange.range(ORDERING, 1, OPEN, 3, OPEN)));
168 GeneralRange<Integer> range = GeneralRange.range(ORDERING, 2, OPEN, 4, CLOSED);
169 assertTrue(range.intersect(GeneralRange.range(ORDERING, 5, CLOSED, 6, CLOSED)).isEmpty());
170 assertTrue(range.intersect(GeneralRange.range(ORDERING, 1, OPEN, 2, OPEN)).isEmpty());
174 assertEquals(GeneralRange.all(Ordering.natural()), GeneralRange.from(Ranges.all()));
179 assertEquals(GeneralRange.upTo(Ordering.natural(), 3, endpointType),
182 assertEquals(GeneralRange.downTo(Ordering.natural(), 3, endpointType),
190 assertEquals(GeneralRange.range(Ordering.natural(), 3, lowerType, 4, upperType),
197 assertEquals(GeneralRange.all(ORDERING.reverse()), GeneralRange.all(ORDERING).reverse());
198 assertEquals(GeneralRange.downTo(ORDERING.reverse(), 3, CLOSED),
199 GeneralRange.upTo(ORDERING, 3, CLOSED).reverse());
200 assertEquals(GeneralRange.upTo(ORDERING.reverse(), 3, OPEN),
201 GeneralRange.downTo(ORDERING, 3, OPEN).reverse());
202 assertEquals(GeneralRange.range(ORDERING.reverse(), 5, OPEN, 3, CLOSED),
203 GeneralRange.range(ORDERING, 3, CLOSED, 5, OPEN).reverse());
209 tester.setDefault(Comparator.class, Ordering.arbitrary());