@Test public void testExclusionAndContains() { IntegerSpace space = _b.including(new SubRange(0, 10)) .excluding(new SubRange(1, 2)) .excluding(new SubRange(5, 6)) .build(); assertTrue("Space not empty", !space.isEmpty()); assertTrue("Space not contiguous", !space.isContiguous()); assertTrue("Space does not contain excluded values", !space.contains(1)); assertTrue("Space does not contain excluded values", !space.contains(2)); assertTrue("Space does not contain excluded values", !space.contains(5)); assertTrue("Space does not contain excluded values", !space.contains(6)); assertTrue( "Space does not contain excluded values", !space.contains(IntegerSpace.builder().including(new SubRange(1, 2)).build())); assertTrue( "Space contains child space", space.contains(IntegerSpace.builder().including(Range.closed(7, 10)).build())); assertTrue( "Space does not contain partially overlapping spaces", !space.contains(IntegerSpace.builder().including(Range.closed(0, 1)).build())); }
public static @Nonnull Builder builder() { return new Builder(); }
IntegerSpace extends NumberSpace<Integer, IntegerSpace, IntegerSpace.Builder> { public static @Nonnull Builder builder() { return new Builder(); } }
IntegerSpace extends NumberSpace<Integer, IntegerSpace, IntegerSpace.Builder> { public static @Nonnull Builder builder() { return new Builder(); } protected  IntegerSpace(RangeSet<Integer> rangeset); }
IntegerSpace extends NumberSpace<Integer, IntegerSpace, IntegerSpace.Builder> { public static @Nonnull Builder builder() { return new Builder(); } protected  IntegerSpace(RangeSet<Integer> rangeset); static @Nonnull IntegerSpace parse(String s); @Nonnull Set<SubRange> getSubRanges(); @Override @Nonnull SortedSet<Integer> enumerate(); @Nonnull IntStream intStream(); static @Nonnull IntegerSpace of(SubRange range); static @Nonnull IntegerSpace unionOf(IntegerSpace... spaces); static @Nonnull IntegerSpace unionOf(SubRange... subRanges); @SafeVarargs @SuppressWarnings("varargs") static @Nonnull IntegerSpace unionOf(Range<Integer>... ranges); static IntegerSpace unionOf(Iterable<Range<Integer>> ranges); static IntegerSpace unionOfSubRanges(Iterable<SubRange> subRanges); static IntegerSpace of(Range<Integer> range); static IntegerSpace of(RangeSet<Integer> rangeSet); static IntegerSpace of(int value); static @Nonnull Builder builder(); }
IntegerSpace extends NumberSpace<Integer, IntegerSpace, IntegerSpace.Builder> { public static @Nonnull Builder builder() { return new Builder(); } protected  IntegerSpace(RangeSet<Integer> rangeset); static @Nonnull IntegerSpace parse(String s); @Nonnull Set<SubRange> getSubRanges(); @Override @Nonnull SortedSet<Integer> enumerate(); @Nonnull IntStream intStream(); static @Nonnull IntegerSpace of(SubRange range); static @Nonnull IntegerSpace unionOf(IntegerSpace... spaces); static @Nonnull IntegerSpace unionOf(SubRange... subRanges); @SafeVarargs @SuppressWarnings("varargs") static @Nonnull IntegerSpace unionOf(Range<Integer>... ranges); static IntegerSpace unionOf(Iterable<Range<Integer>> ranges); static IntegerSpace unionOfSubRanges(Iterable<SubRange> subRanges); static IntegerSpace of(Range<Integer> range); static IntegerSpace of(RangeSet<Integer> rangeSet); static IntegerSpace of(int value); static @Nonnull Builder builder(); static final IntegerSpace EMPTY; static final IntegerSpace PORTS; }