Class ContiguousSet<C extends Comparable>

All Implemented Interfaces:
Serializable, Iterable<C>, Collection<C>, NavigableSet<C>, SequencedCollection<C>, SequencedSet<C>, Set<C>, SortedSet<C>

@GwtCompatible(emulated=true) public abstract class ContiguousSet<C extends Comparable> extends ImmutableSortedSet<C>
A sorted set of contiguous values in a given DiscreteDomain. Example:

 ContiguousSet.create(Range.closed(5, 42), DiscreteDomain.integers())
 

Note that because bounded ranges over int and long values are so common, this particular example can be written as just:


 ContiguousSet.closed(5, 42)
 

Warning: Be extremely careful what you do with conceptually large instances (such as ContiguousSet.create(Range.greaterThan(0), DiscreteDomain.integers()). Certain operations on such a set can be performed efficiently, but others (such as Set.hashCode() or Collections.frequency(java.util.Collection<?>, java.lang.Object)) can cause major performance problems.

Since:
10.0
Author:
Gregory Kick
See Also: