final class EmptyContiguousSet<C extends java.lang.Comparable> extends ContiguousSet<C>
| Modifier and Type | Class and Description |
|---|---|
private static class |
EmptyContiguousSet.SerializedForm<C extends java.lang.Comparable> |
ImmutableSortedSet.Builder<E>ImmutableSet.CachingAsList<E>, ImmutableSet.Indexed<E>domaincomparator, descendingSet, SPLITERATOR_CHARACTERISTICSMAX_TABLE_SIZE| Constructor and Description |
|---|
EmptyContiguousSet(DiscreteDomain<C> domain) |
| Modifier and Type | Method and Description |
|---|---|
ImmutableList<C> |
asList()
Returns an
ImmutableList containing the same elements, in the same order, as this
collection. |
boolean |
contains(java.lang.Object object) |
(package private) ImmutableSortedSet<C> |
createDescendingSet() |
UnmodifiableIterator<C> |
descendingIterator() |
boolean |
equals(java.lang.Object object) |
C |
first() |
int |
hashCode() |
(package private) ContiguousSet<C> |
headSetImpl(C toElement,
boolean inclusive) |
(package private) int |
indexOf(java.lang.Object target)
Returns the position of an element within the set, or -1 if not present.
|
ContiguousSet<C> |
intersection(ContiguousSet<C> other)
Returns the set of values that are contained in both this set and the other.
|
boolean |
isEmpty() |
(package private) boolean |
isHashCodeFast()
Returns
true if the hashCode() method runs quickly. |
(package private) boolean |
isPartialView()
Returns
true if this immutable collection's implementation contains references to
user-created objects that aren't accessible via this collection's methods. |
UnmodifiableIterator<C> |
iterator()
Returns an unmodifiable iterator across the elements in this collection.
|
C |
last() |
Range<C> |
range()
Returns a range, closed on both ends, whose endpoints are the minimum and maximum values
contained in this set.
|
Range<C> |
range(BoundType lowerBoundType,
BoundType upperBoundType)
Returns the minimal range with the given boundary types for which all values in this set are
contained within the range.
|
int |
size() |
(package private) ContiguousSet<C> |
subSetImpl(C fromElement,
boolean fromInclusive,
C toElement,
boolean toInclusive) |
(package private) ContiguousSet<C> |
tailSetImpl(C fromElement,
boolean fromInclusive) |
java.lang.String |
toString()
Returns a short-hand representation of the contents such as
"[1..100]". |
(package private) java.lang.Object |
writeReplace() |
builder, closed, closed, closedOpen, closedOpen, create, headSet, headSet, subSet, subSet, tailSet, tailSetceiling, comparator, construct, copyOf, copyOf, copyOf, copyOf, copyOf, copyOf, copyOf, copyOfSorted, descendingSet, emptySet, floor, higher, lower, naturalOrder, of, of, of, of, of, of, of, orderedBy, pollFirst, pollLast, reverseOrder, spliterator, toImmutableSortedSet, unsafeCompare, unsafeComparebuilderWithExpectedSize, toImmutableSetcreateAsListchooseTableSizeadd, addAll, clear, copyIntoArray, internalArray, internalArrayEnd, internalArrayStart, remove, removeAll, removeIf, retainAll, toArray, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitEmptyContiguousSet(DiscreteDomain<C> domain)
public C first()
first in interface java.util.SortedSet<C extends java.lang.Comparable>first in class ImmutableSortedSet<C extends java.lang.Comparable>public C last()
last in interface java.util.SortedSet<C extends java.lang.Comparable>last in class ImmutableSortedSet<C extends java.lang.Comparable>public int size()
public ContiguousSet<C> intersection(ContiguousSet<C> other)
ContiguousSetThis method should always be used instead of Sets.intersection(java.util.Set<E>, java.util.Set<?>) for ContiguousSet instances.
intersection in class ContiguousSet<C extends java.lang.Comparable>public Range<C> range()
ContiguousSetrange(CLOSED, CLOSED).range in class ContiguousSet<C extends java.lang.Comparable>public Range<C> range(BoundType lowerBoundType, BoundType upperBoundType)
ContiguousSetNote that this method will return ranges with unbounded endpoints if BoundType.OPEN
is requested for a domain minimum or maximum. For example, if set was created from the
range [1..Integer.MAX_VALUE] then set.range(CLOSED, OPEN) must return [1..∞).
range in class ContiguousSet<C extends java.lang.Comparable>ContiguousSet<C> headSetImpl(C toElement, boolean inclusive)
headSetImpl in class ContiguousSet<C extends java.lang.Comparable>ContiguousSet<C> subSetImpl(C fromElement, boolean fromInclusive, C toElement, boolean toInclusive)
subSetImpl in class ContiguousSet<C extends java.lang.Comparable>ContiguousSet<C> tailSetImpl(C fromElement, boolean fromInclusive)
tailSetImpl in class ContiguousSet<C extends java.lang.Comparable>public boolean contains(@CheckForNull
java.lang.Object object)
contains in interface java.util.Collection<C extends java.lang.Comparable>contains in interface java.util.Set<C extends java.lang.Comparable>contains in class ImmutableCollection<C extends java.lang.Comparable>int indexOf(@CheckForNull
java.lang.Object target)
ImmutableSortedSetindexOf in class ImmutableSortedSet<C extends java.lang.Comparable>public UnmodifiableIterator<C> iterator()
ImmutableCollectioniterator in interface SortedIterable<C extends java.lang.Comparable>iterator in interface java.lang.Iterable<C extends java.lang.Comparable>iterator in interface java.util.Collection<C extends java.lang.Comparable>iterator in interface java.util.NavigableSet<C extends java.lang.Comparable>iterator in interface java.util.Set<C extends java.lang.Comparable>iterator in class ImmutableSortedSet<C extends java.lang.Comparable>public UnmodifiableIterator<C> descendingIterator()
descendingIterator in interface java.util.NavigableSet<C extends java.lang.Comparable>descendingIterator in class ImmutableSortedSet<C extends java.lang.Comparable>boolean isPartialView()
ImmutableCollectiontrue if this immutable collection's implementation contains references to
user-created objects that aren't accessible via this collection's methods. This is generally
used to determine whether copyOf implementations should make an explicit copy to avoid
memory leaks.isPartialView in class ImmutableCollection<C extends java.lang.Comparable>public boolean isEmpty()
public ImmutableList<C> asList()
ImmutableCollectionImmutableList containing the same elements, in the same order, as this
collection.
Performance note: in most cases this method can return quickly without actually copying anything. The exact circumstances under which the copy is performed are undefined and subject to change.
asList in class ImmutableSet.CachingAsList<C extends java.lang.Comparable>public java.lang.String toString()
ContiguousSet"[1..100]".toString in class ContiguousSet<C extends java.lang.Comparable>public boolean equals(@CheckForNull
java.lang.Object object)
equals in interface java.util.Collection<C extends java.lang.Comparable>equals in interface java.util.Set<C extends java.lang.Comparable>equals in class ImmutableSet<C extends java.lang.Comparable>boolean isHashCodeFast()
ImmutableSettrue if the hashCode() method runs quickly.isHashCodeFast in class ImmutableSet<C extends java.lang.Comparable>public int hashCode()
hashCode in interface java.util.Collection<C extends java.lang.Comparable>hashCode in interface java.util.Set<C extends java.lang.Comparable>hashCode in class ImmutableSet<C extends java.lang.Comparable>java.lang.Object writeReplace()
writeReplace in class ImmutableSortedSet<C extends java.lang.Comparable>ImmutableSortedSet<C> createDescendingSet()
createDescendingSet in class ContiguousSet<C extends java.lang.Comparable>