Class ImmutableRangeSet.AsSet

  • 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>
    Enclosing class:
    ImmutableRangeSet<C extends java.lang.Comparable>

    private final class ImmutableRangeSet.AsSet
    extends ImmutableSortedSet<C>
    • Field Detail

      • domain

        private final DiscreteDomain<C extends java.lang.Comparable> domain
      • size

        private transient java.lang.Integer size
    • Method Detail

      • 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>
      • 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>
      • contains

        public boolean contains​(@Nullable
                                java.lang.Object o)
        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>
      • indexOf

        int indexOf​(java.lang.Object target)
        Description copied from class: ImmutableSortedSet
        Returns the position of an element within the set, or -1 if not present.
        Specified by:
        indexOf 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>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.util.AbstractCollection<C extends java.lang.Comparable>