Class EmptyContiguousSet<C extends java.lang.Comparable>

  • All Implemented Interfaces:
    SortedIterable<C>, java.io.Serializable, java.lang.Iterable<C>, java.util.Collection<C>, java.util.NavigableSet<C>, java.util.Set<C>, java.util.SortedSet<C>

    @GwtCompatible(emulated=true)
    final class EmptyContiguousSet<C extends java.lang.Comparable>
    extends ContiguousSet<C>
    An empty contiguous set.
    • Constructor Detail

    • Method Detail

      • first

        public C first()
        Specified by:
        first in interface java.util.SortedSet<C extends java.lang.Comparable>
        Overrides:
        first in class ImmutableSortedSet<C extends java.lang.Comparable>
      • last

        public C last()
        Specified by:
        last in interface java.util.SortedSet<C extends java.lang.Comparable>
        Overrides:
        last in class ImmutableSortedSet<C extends java.lang.Comparable>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<C extends java.lang.Comparable>
        Specified by:
        size in interface java.util.Set<C extends java.lang.Comparable>
        Specified by:
        size in class java.util.AbstractCollection<C extends java.lang.Comparable>
      • range

        public Range<C> range()
        Description copied from class: ContiguousSet
        Returns a range, closed on both ends, whose endpoints are the minimum and maximum values contained in this set. This is equivalent to range(CLOSED, CLOSED).
        Specified by:
        range in class ContiguousSet<C extends java.lang.Comparable>
      • range

        public Range<C> range​(BoundType lowerBoundType,
                              BoundType upperBoundType)
        Description copied from class: ContiguousSet
        Returns the minimal range with the given boundary types for which all values in this set are contained within the range.

        Note 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..∞).

        Specified by:
        range in class ContiguousSet<C extends java.lang.Comparable>
      • subSetImpl

        ContiguousSet<C> subSetImpl​(C fromElement,
                                    boolean fromInclusive,
                                    C toElement,
                                    boolean toInclusive)
        Specified by:
        subSetImpl in class ContiguousSet<C extends java.lang.Comparable>
      • contains

        public boolean contains​(java.lang.Object object)
        Specified by:
        contains in interface java.util.Collection<C extends java.lang.Comparable>
        Specified by:
        contains in interface java.util.Set<C extends java.lang.Comparable>
        Specified by:
        contains in class ImmutableCollection<C extends java.lang.Comparable>
      • iterator

        public UnmodifiableIterator<C> iterator()
        Description copied from class: ImmutableCollection
        Returns an unmodifiable iterator across the elements in this collection.
        Specified by:
        iterator in interface java.util.Collection<C extends java.lang.Comparable>
        Specified by:
        iterator in interface java.lang.Iterable<C extends java.lang.Comparable>
        Specified by:
        iterator in interface java.util.NavigableSet<C extends java.lang.Comparable>
        Specified by:
        iterator in interface java.util.Set<C extends java.lang.Comparable>
        Specified by:
        iterator in interface SortedIterable<C extends java.lang.Comparable>
        Specified by:
        iterator in class ImmutableSortedSet<C extends java.lang.Comparable>
      • isPartialView

        boolean isPartialView()
        Description copied from class: ImmutableCollection
        Returns true 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.
        Specified by:
        isPartialView in class ImmutableCollection<C extends java.lang.Comparable>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<C extends java.lang.Comparable>
        Specified by:
        isEmpty in interface java.util.Set<C extends java.lang.Comparable>
        Overrides:
        isEmpty in class java.util.AbstractCollection<C extends java.lang.Comparable>
      • asList

        public ImmutableList<C> asList()
        Description copied from class: ImmutableCollection
        Returns an ImmutableList 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.

        Overrides:
        asList in class ImmutableSet<C extends java.lang.Comparable>
      • toString

        public java.lang.String toString()
        Description copied from class: ContiguousSet
        Returns a short-hand representation of the contents such as "[1..100]".
        Overrides:
        toString in class ContiguousSet<C extends java.lang.Comparable>
      • equals

        public boolean equals​(java.lang.Object object)
        Specified by:
        equals in interface java.util.Collection<C extends java.lang.Comparable>
        Specified by:
        equals in interface java.util.Set<C extends java.lang.Comparable>
        Overrides:
        equals in class ImmutableSet<C extends java.lang.Comparable>
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Collection<C extends java.lang.Comparable>
        Specified by:
        hashCode in interface java.util.Set<C extends java.lang.Comparable>
        Overrides:
        hashCode in class ImmutableSet<C extends java.lang.Comparable>