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