Class AbstractBitVector.LongSetView

java.lang.Object
java.util.AbstractCollection<Long>
it.unimi.dsi.fastutil.longs.AbstractLongCollection
it.unimi.dsi.fastutil.longs.AbstractLongSet
it.unimi.dsi.fastutil.longs.AbstractLongSortedSet
it.unimi.dsi.bits.AbstractBitVector.LongSetView
All Implemented Interfaces:
it.unimi.dsi.fastutil.longs.LongBidirectionalIterable, it.unimi.dsi.fastutil.longs.LongCollection, it.unimi.dsi.fastutil.longs.LongIterable, it.unimi.dsi.fastutil.longs.LongSet, it.unimi.dsi.fastutil.longs.LongSortedSet, it.unimi.dsi.fastutil.Size64, Serializable, Cloneable, Iterable<Long>, Collection<Long>, SequencedCollection<Long>, SequencedSet<Long>, Set<Long>, SortedSet<Long>
Enclosing class:
AbstractBitVector

public static class AbstractBitVector.LongSetView extends it.unimi.dsi.fastutil.longs.AbstractLongSortedSet implements it.unimi.dsi.fastutil.longs.LongSet, Serializable, it.unimi.dsi.fastutil.Size64
A view of a bit vector as a sorted set of long integers.

This class implements a view of a subvector as a sorted set of long integers using the subvector as a bit mask. If the end position is Long.MAX_VALUE, the vector is enlarged as needed (i.e., when a one beyond the current size is set), but it is never shrunk.

Outside of the specified range {contains(long) will return false and add(long) will cause an UnsupportedOperationException.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final BitVector
    The underlying bit vector.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LongSetView(BitVector bitVector, long from, long to)
    Creates a new view on a subvector.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(long index)
     
    void
     
    it.unimi.dsi.fastutil.longs.LongComparator
     
    boolean
    contains(long index)
     
    long
     
    it.unimi.dsi.fastutil.longs.LongSortedSet
    headSet(long to)
     
    it.unimi.dsi.fastutil.longs.LongBidirectionalIterator
     
    it.unimi.dsi.fastutil.longs.LongBidirectionalIterator
    iterator(long from)
     
    long
     
    boolean
    remove(long index)
     
    int
    Deprecated.
    long
     
    it.unimi.dsi.fastutil.longs.LongSortedSet
    subSet(long from, long to)
     
    it.unimi.dsi.fastutil.longs.LongSortedSet
    tailSet(long from)
     

    Methods inherited from class it.unimi.dsi.fastutil.longs.AbstractLongSet

    equals, hashCode, rem

    Methods inherited from class it.unimi.dsi.fastutil.longs.AbstractLongCollection

    add, addAll, addAll, contains, containsAll, containsAll, forEach, remove, removeAll, removeAll, removeIf, retainAll, retainAll, toArray, toLongArray, toLongArray, toString

    Methods inherited from class java.util.AbstractCollection

    isEmpty, toArray, toArray

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.util.Collection

    toArray

    Methods inherited from interface it.unimi.dsi.fastutil.longs.LongCollection

    addAll, containsAll, longIterator, longParallelStream, longSpliterator, longStream, parallelStream, removeAll, removeIf, removeIf, removeIf, retainAll, stream, toArray, toLongArray, toLongArray

    Methods inherited from interface it.unimi.dsi.fastutil.longs.LongIterable

    forEach, forEach, forEach

    Methods inherited from interface it.unimi.dsi.fastutil.longs.LongSet

    add, contains, rem, remove

    Methods inherited from interface it.unimi.dsi.fastutil.longs.LongSortedSet

    first, headSet, last, spliterator, subSet, tailSet

    Methods inherited from interface java.util.Set

    add, addAll, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArray

    Methods inherited from interface java.util.SortedSet

    addFirst, addLast, getFirst, getLast, removeFirst, removeLast, reversed
  • Field Details

    • bitVector

      protected final BitVector bitVector
      The underlying bit vector.
  • Constructor Details

    • LongSetView

      public LongSetView(BitVector bitVector, long from, long to)
      Creates a new view on a subvector.
      Parameters:
      bitVector - the underlying bit vector.
      from - the first index (inclusive).
      to - the last index (not inclusive).
  • Method Details

    • contains

      public boolean contains(long index)
      Specified by:
      contains in interface it.unimi.dsi.fastutil.longs.LongCollection
      Overrides:
      contains in class it.unimi.dsi.fastutil.longs.AbstractLongCollection
    • add

      public boolean add(long index)
      Specified by:
      add in interface it.unimi.dsi.fastutil.longs.LongCollection
      Overrides:
      add in class it.unimi.dsi.fastutil.longs.AbstractLongCollection
    • remove

      public boolean remove(long index)
      Specified by:
      remove in interface it.unimi.dsi.fastutil.longs.LongSet
      Overrides:
      remove in class it.unimi.dsi.fastutil.longs.AbstractLongSet
    • clear

      public void clear()
      Specified by:
      clear in interface Collection<Long>
      Specified by:
      clear in interface Set<Long>
      Overrides:
      clear in class AbstractCollection<Long>
    • size64

      public long size64()
      Specified by:
      size64 in interface it.unimi.dsi.fastutil.Size64
    • size

      @Deprecated public int size()
      Deprecated.
      Specified by:
      size in interface Collection<Long>
      Specified by:
      size in interface Set<Long>
      Specified by:
      size in interface it.unimi.dsi.fastutil.Size64
      Specified by:
      size in class AbstractCollection<Long>
    • iterator

      public it.unimi.dsi.fastutil.longs.LongBidirectionalIterator 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 it.unimi.dsi.fastutil.longs.LongSet
      Specified by:
      iterator in interface it.unimi.dsi.fastutil.longs.LongSortedSet
      Specified by:
      iterator in interface Set<Long>
      Specified by:
      iterator in class it.unimi.dsi.fastutil.longs.AbstractLongSortedSet
    • iterator

      public it.unimi.dsi.fastutil.longs.LongBidirectionalIterator iterator(long from)
      Specified by:
      iterator in interface it.unimi.dsi.fastutil.longs.LongSortedSet
    • firstLong

      public long firstLong()
      Specified by:
      firstLong in interface it.unimi.dsi.fastutil.longs.LongSortedSet
    • lastLong

      public long lastLong()
      Specified by:
      lastLong in interface it.unimi.dsi.fastutil.longs.LongSortedSet
    • comparator

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

      public it.unimi.dsi.fastutil.longs.LongSortedSet headSet(long to)
      Specified by:
      headSet in interface it.unimi.dsi.fastutil.longs.LongSortedSet
    • tailSet

      public it.unimi.dsi.fastutil.longs.LongSortedSet tailSet(long from)
      Specified by:
      tailSet in interface it.unimi.dsi.fastutil.longs.LongSortedSet
    • subSet

      public it.unimi.dsi.fastutil.longs.LongSortedSet subSet(long from, long to)
      Specified by:
      subSet in interface it.unimi.dsi.fastutil.longs.LongSortedSet