Lines Matching defs:ORDERING
37 private static final Ordering<Integer> ORDERING = Ordering.natural().nullsFirst();
45 GeneralRange.range(ORDERING, 4, lboundType, 2, uboundType);
55 GeneralRange.range(ORDERING, i, OPEN, i, OPEN);
63 GeneralRange<Integer> range = GeneralRange.range(ORDERING, i, CLOSED, i, OPEN);
72 GeneralRange<Integer> range = GeneralRange.range(ORDERING, i, OPEN, i, CLOSED);
81 GeneralRange<Integer> range = GeneralRange.range(ORDERING, i, CLOSED, i, CLOSED);
89 GeneralRange<Integer> range = GeneralRange.range(ORDERING, 3, CLOSED, 3, CLOSED);
91 assertEquals(ORDERING.compare(i, 3) == 0, range.contains(i));
97 GeneralRange<Integer> range = GeneralRange.downTo(ORDERING, 3, lBoundType);
99 assertEquals(ORDERING.compare(i, 3) > 0
100 || (ORDERING.compare(i, 3) == 0 && lBoundType == CLOSED), range.contains(i));
101 assertEquals(ORDERING.compare(i, 3) < 0
102 || (ORDERING.compare(i, 3) == 0 && lBoundType == OPEN), range.tooLow(i));
110 GeneralRange<Integer> range = GeneralRange.upTo(ORDERING, 3, lBoundType);
112 assertEquals(ORDERING.compare(i, 3) < 0
113 || (ORDERING.compare(i, 3) == 0 && lBoundType == CLOSED), range.contains(i));
114 assertEquals(ORDERING.compare(i, 3) > 0
115 || (ORDERING.compare(i, 3) == 0 && lBoundType == OPEN), range.tooHigh(i));
125 GeneralRange<Integer> gRange = GeneralRange.range(ORDERING, 2, lboundType, 4, uboundType);
134 GeneralRange<Integer> range = GeneralRange.range(ORDERING, 2, CLOSED, 4, OPEN);
135 assertEquals(GeneralRange.range(ORDERING, 2, OPEN, 4, OPEN),
136 range.intersect(GeneralRange.range(ORDERING, 2, OPEN, 4, CLOSED)));
140 GeneralRange<Integer> range = GeneralRange.range(ORDERING, 2, CLOSED, 4, OPEN);
142 assertEquals(GeneralRange.range(ORDERING, 2, CLOSED, 4, OPEN),
143 range.intersect(GeneralRange.range(ORDERING, null, OPEN, 5, CLOSED)));
145 assertEquals(GeneralRange.range(ORDERING, 2, OPEN, 4, OPEN),
146 range.intersect(GeneralRange.range(ORDERING, 2, OPEN, 5, CLOSED)));
148 assertEquals(GeneralRange.range(ORDERING, 2, CLOSED, 4, OPEN),
149 range.intersect(GeneralRange.range(ORDERING, 1, OPEN, 4, OPEN)));
153 GeneralRange<Integer> range = GeneralRange.range(ORDERING, 2, OPEN, 4, OPEN);
154 assertEquals(GeneralRange.range(ORDERING, 3, CLOSED, 4, OPEN),
155 range.intersect(GeneralRange.range(ORDERING, 3, CLOSED, 4, CLOSED)));
159 GeneralRange<Integer> range = GeneralRange.range(ORDERING, 2, OPEN, 4, CLOSED);
160 assertEquals(GeneralRange.range(ORDERING, 3, CLOSED, 4, CLOSED),
161 range.intersect(GeneralRange.range(ORDERING, 3, CLOSED, 5, CLOSED)));
162 assertEquals(GeneralRange.range(ORDERING, 2, OPEN, 3, OPEN),
163 range.intersect(GeneralRange.range(ORDERING, 1, OPEN, 3, OPEN)));
167 GeneralRange<Integer> range = GeneralRange.range(ORDERING, 2, OPEN, 4, CLOSED);
168 assertTrue(range.intersect(GeneralRange.range(ORDERING, 5, CLOSED, 6, CLOSED)).isEmpty());
169 assertTrue(range.intersect(GeneralRange.range(ORDERING, 1, OPEN, 2, OPEN)).isEmpty());
173 assertEquals(GeneralRange.all(Ordering.natural()), GeneralRange.from(Range.all()));
178 assertEquals(GeneralRange.upTo(Ordering.natural(), 3, endpointType),
181 assertEquals(GeneralRange.downTo(Ordering.natural(), 3, endpointType),
189 assertEquals(GeneralRange.range(Ordering.natural(), 3, lowerType, 4, upperType),
196 assertEquals(GeneralRange.all(ORDERING.reverse()), GeneralRange.all(ORDERING).reverse());
197 assertEquals(GeneralRange.downTo(ORDERING.reverse(), 3, CLOSED),
198 GeneralRange.upTo(ORDERING, 3, CLOSED).reverse());
199 assertEquals(GeneralRange.upTo(ORDERING.reverse(), 3, OPEN),
200 GeneralRange.downTo(ORDERING, 3, OPEN).reverse());
201 assertEquals(GeneralRange.range(ORDERING.reverse(), 5, OPEN, 3, CLOSED),
202 GeneralRange.range(ORDERING, 3, CLOSED, 5, OPEN).reverse());