Class LongSortedSets.UnmodifiableSortedSet

java.lang.Object
it.unimi.dsi.fastutil.longs.LongSets.UnmodifiableSet
it.unimi.dsi.fastutil.longs.LongSortedSets.UnmodifiableSortedSet
All Implemented Interfaces:
it.unimi.dsi.fastutil.longs.LongBidirectionalIterable, it.unimi.dsi.fastutil.longs.LongCollection, it.unimi.dsi.fastutil.longs.LongIterable, LongSet, LongSortedSet, Serializable, Iterable<Long>, Collection<Long>, SequencedCollection<Long>, SequencedSet<Long>, Set<Long>, SortedSet<Long>
Enclosing class:
LongSortedSets

public static class LongSortedSets.UnmodifiableSortedSet extends LongSets.UnmodifiableSet implements LongSortedSet, Serializable
An unmodifiable wrapper class for sorted sets.
See Also:
  • Field Details

    • sortedSet

      protected final LongSortedSet sortedSet
    • collection

      protected final it.unimi.dsi.fastutil.longs.LongCollection collection
  • Constructor Details

    • UnmodifiableSortedSet

      protected UnmodifiableSortedSet(LongSortedSet s)
  • Method Details

    • comparator

      public it.unimi.dsi.fastutil.longs.LongComparator comparator()
      Description copied from interface: LongSortedSet
      Specified by:
      comparator in interface LongSortedSet
      Specified by:
      comparator in interface SortedSet<Long>
    • subSet

      public LongSortedSet subSet(long from, long to)
      Description copied from interface: LongSortedSet
      Returns a view of the portion of this sorted set whose elements range from fromElement, inclusive, to toElement, exclusive.
      Specified by:
      subSet in interface LongSortedSet
      See Also:
    • headSet

      public LongSortedSet headSet(long to)
      Description copied from interface: LongSortedSet
      Returns a view of the portion of this sorted set whose elements are strictly less than toElement.
      Specified by:
      headSet in interface LongSortedSet
      See Also:
    • tailSet

      public LongSortedSet tailSet(long from)
      Description copied from interface: LongSortedSet
      Returns a view of the portion of this sorted set whose elements are greater than or equal to fromElement.
      Specified by:
      tailSet in interface LongSortedSet
      See Also:
    • iterator

      public it.unimi.dsi.fastutil.longs.LongBidirectionalIterator iterator()
      Description copied from interface: LongSortedSet
      Returns a type-specific BidirectionalIterator on the elements in this set.

      This method returns a parameterised bidirectional iterator. The iterator can be moreover safely cast to a type-specific iterator.

      Specified by:
      iterator in interface Collection<Long>
      Specified by:
      iterator in interface Iterable<Long>
      Specified by:
      iterator in interface it.unimi.dsi.fastutil.longs.LongBidirectionalIterable
      Specified by:
      iterator in interface it.unimi.dsi.fastutil.longs.LongCollection
      Specified by:
      iterator in interface it.unimi.dsi.fastutil.longs.LongIterable
      Specified by:
      iterator in interface LongSet
      Specified by:
      iterator in interface LongSortedSet
      Specified by:
      iterator in interface Set<Long>
      Returns:
      a bidirectional iterator on the element in this set.
    • iterator

      public it.unimi.dsi.fastutil.longs.LongBidirectionalIterator iterator(long from)
      Description copied from interface: LongSortedSet
      Returns a type-specific BidirectionalIterator on the elements in this set, starting from a given element of the domain (optional operation).

      This method returns a type-specific bidirectional iterator with given starting point. The starting point is any element comparable to the elements of this set (even if it does not actually belong to the set). The next element of the returned iterator is the least element of the set that is greater than the starting point (if there are no elements greater than the starting point, hasNext() will return false). The previous element of the returned iterator is the greatest element of the set that is smaller than or equal to the starting point (if there are no elements smaller than or equal to the starting point, hasPrevious() will return false).

      Note that passing the last element of the set as starting point and calling previous() you can traverse the entire set in reverse order.

      Specified by:
      iterator in interface LongSortedSet
      Parameters:
      from - an element to start from.
      Returns:
      a bidirectional iterator on the element in this set, starting at the given element.
    • firstLong

      public long firstLong()
      Description copied from interface: LongSortedSet
      Returns the first (lowest) element currently in this set.
      Specified by:
      firstLong in interface LongSortedSet
      See Also:
    • lastLong

      public long lastLong()
      Description copied from interface: LongSortedSet
      Returns the last (highest) element currently in this set.
      Specified by:
      lastLong in interface LongSortedSet
      See Also:
    • first

      @Deprecated public Long first()
      Deprecated.
      Please use the corresponding type-specific method instead.
      Specified by:
      first in interface LongSortedSet
      Specified by:
      first in interface SortedSet<Long>
    • last

      @Deprecated public Long last()
      Deprecated.
      Please use the corresponding type-specific method instead.
      Specified by:
      last in interface LongSortedSet
      Specified by:
      last in interface SortedSet<Long>
    • subSet

      @Deprecated public LongSortedSet subSet(Long from, Long to)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Specified by:
      subSet in interface LongSortedSet
      Specified by:
      subSet in interface SortedSet<Long>
    • headSet

      @Deprecated public LongSortedSet headSet(Long to)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Specified by:
      headSet in interface LongSortedSet
      Specified by:
      headSet in interface SortedSet<Long>
    • tailSet

      @Deprecated public LongSortedSet tailSet(Long from)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Specified by:
      tailSet in interface LongSortedSet
      Specified by:
      tailSet in interface SortedSet<Long>
    • add

      public boolean add(long arg0)
      Specified by:
      add in interface it.unimi.dsi.fastutil.longs.LongCollection
    • size

      public int size()
      Specified by:
      size in interface Collection<Long>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Collection<Long>
    • contains

      public boolean contains(long arg0)
      Specified by:
      contains in interface it.unimi.dsi.fastutil.longs.LongCollection
    • spliterator

      public it.unimi.dsi.fastutil.longs.LongSpliterator spliterator()
      Specified by:
      spliterator in interface Collection<Long>
      Specified by:
      spliterator in interface Iterable<Long>
      Specified by:
      spliterator in interface it.unimi.dsi.fastutil.longs.LongCollection
      Specified by:
      spliterator in interface it.unimi.dsi.fastutil.longs.LongIterable
    • stream

      @Deprecated public Stream<Long> stream()
      Deprecated.
      Specified by:
      stream in interface Collection<Long>
      Specified by:
      stream in interface it.unimi.dsi.fastutil.longs.LongCollection
    • parallelStream

      @Deprecated public Stream<Long> parallelStream()
      Deprecated.
      Specified by:
      parallelStream in interface Collection<Long>
      Specified by:
      parallelStream in interface it.unimi.dsi.fastutil.longs.LongCollection
    • clear

      public void clear()
      Specified by:
      clear in interface Collection<Long>
    • toArray

      public <T> T[] toArray(T[] arg0)
      Specified by:
      toArray in interface Collection<Long>
    • toArray

      public Object[] toArray()
      Specified by:
      toArray in interface Collection<Long>
    • forEach

      public void forEach(LongConsumer arg0)
      Specified by:
      forEach in interface it.unimi.dsi.fastutil.longs.LongIterable
    • containsAll

      public boolean containsAll(Collection<?> arg0)
      Specified by:
      containsAll in interface Collection<Long>
    • addAll

      public boolean addAll(Collection<? extends Long> arg0)
      Specified by:
      addAll in interface Collection<Long>
    • removeAll

      public boolean removeAll(Collection<?> arg0)
      Specified by:
      removeAll in interface Collection<Long>
    • retainAll

      public boolean retainAll(Collection<?> arg0)
      Specified by:
      retainAll in interface Collection<Long>
    • removeIf

      public boolean removeIf(LongPredicate arg0)
      Specified by:
      removeIf in interface it.unimi.dsi.fastutil.longs.LongCollection
    • add

      @Deprecated public boolean add(Long arg0)
      Deprecated.
      Specified by:
      add in interface Collection<Long>
      Specified by:
      add in interface it.unimi.dsi.fastutil.longs.LongCollection
    • contains

      @Deprecated public boolean contains(Object arg0)
      Deprecated.
      Specified by:
      contains in interface Collection<Long>
      Specified by:
      contains in interface it.unimi.dsi.fastutil.longs.LongCollection
    • remove

      @Deprecated public boolean remove(Object arg0)
      Deprecated.
      Specified by:
      remove in interface Collection<Long>
      Specified by:
      remove in interface it.unimi.dsi.fastutil.longs.LongCollection
    • toLongArray

      public long[] toLongArray()
      Specified by:
      toLongArray in interface it.unimi.dsi.fastutil.longs.LongCollection
    • toLongArray

      @Deprecated public long[] toLongArray(long[] arg0)
      Deprecated.
      Specified by:
      toLongArray in interface it.unimi.dsi.fastutil.longs.LongCollection
    • toArray

      public long[] toArray(long[] arg0)
      Specified by:
      toArray in interface it.unimi.dsi.fastutil.longs.LongCollection
    • containsAll

      public boolean containsAll(it.unimi.dsi.fastutil.longs.LongCollection arg0)
      Specified by:
      containsAll in interface it.unimi.dsi.fastutil.longs.LongCollection
    • addAll

      public boolean addAll(it.unimi.dsi.fastutil.longs.LongCollection arg0)
      Specified by:
      addAll in interface it.unimi.dsi.fastutil.longs.LongCollection
    • removeAll

      public boolean removeAll(it.unimi.dsi.fastutil.longs.LongCollection arg0)
      Specified by:
      removeAll in interface it.unimi.dsi.fastutil.longs.LongCollection
    • retainAll

      public boolean retainAll(it.unimi.dsi.fastutil.longs.LongCollection arg0)
      Specified by:
      retainAll in interface it.unimi.dsi.fastutil.longs.LongCollection
    • longIterator

      public it.unimi.dsi.fastutil.longs.LongIterator longIterator()
      Specified by:
      longIterator in interface it.unimi.dsi.fastutil.longs.LongCollection
      Specified by:
      longIterator in interface it.unimi.dsi.fastutil.longs.LongIterable
    • longSpliterator

      public it.unimi.dsi.fastutil.longs.LongSpliterator longSpliterator()
      Specified by:
      longSpliterator in interface it.unimi.dsi.fastutil.longs.LongCollection
      Specified by:
      longSpliterator in interface it.unimi.dsi.fastutil.longs.LongIterable
    • longStream

      public LongStream longStream()
      Specified by:
      longStream in interface it.unimi.dsi.fastutil.longs.LongCollection
    • longParallelStream

      public LongStream longParallelStream()
      Specified by:
      longParallelStream in interface it.unimi.dsi.fastutil.longs.LongCollection
    • toString

      public String toString()
      Overrides:
      toString in class Object