Package it.unimi.dsi.bits
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:
LongBidirectionalIterable
,LongCollection
,LongIterable
,LongSet
,LongSortedSet
,Size64
,Serializable
,Cloneable
,Iterable<Long>
,Collection<Long>
,Set<Long>
,SortedSet<Long>
- Enclosing class:
- AbstractBitVector
public static class AbstractBitVector.LongSetView
extends AbstractLongSortedSet
implements LongSet, Serializable, 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
-
Constructor Summary
ConstructorDescriptionLongSetView
(BitVector bitVector, long from, long to) Creates a new view on a subvector. -
Method Summary
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.LongSortedSet
first, headSet, last, spliterator, subSet, tailSet
-
Field Details
-
bitVector
The underlying bit vector.
-
-
Constructor Details
-
LongSetView
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 interfaceLongCollection
- Overrides:
contains
in classAbstractLongCollection
-
add
public boolean add(long index) - Specified by:
add
in interfaceLongCollection
- Overrides:
add
in classAbstractLongCollection
-
remove
public boolean remove(long index) - Specified by:
remove
in interfaceLongSet
- Overrides:
remove
in classAbstractLongSet
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<Long>
- Specified by:
clear
in interfaceSet<Long>
- Overrides:
clear
in classAbstractCollection<Long>
-
size64
public long size64() -
size
Deprecated. -
iterator
- Specified by:
iterator
in interfaceCollection<Long>
- Specified by:
iterator
in interfaceIterable<Long>
- Specified by:
iterator
in interfaceLongBidirectionalIterable
- Specified by:
iterator
in interfaceLongCollection
- Specified by:
iterator
in interfaceLongIterable
- Specified by:
iterator
in interfaceLongSet
- Specified by:
iterator
in interfaceLongSortedSet
- Specified by:
iterator
in interfaceSet<Long>
- Specified by:
iterator
in classAbstractLongSortedSet
-
iterator
- Specified by:
iterator
in interfaceLongSortedSet
-
firstLong
public long firstLong()- Specified by:
firstLong
in interfaceLongSortedSet
-
lastLong
public long lastLong()- Specified by:
lastLong
in interfaceLongSortedSet
-
comparator
- Specified by:
comparator
in interfaceLongSortedSet
- Specified by:
comparator
in interfaceSortedSet<Long>
-
headSet
- Specified by:
headSet
in interfaceLongSortedSet
-
tailSet
- Specified by:
tailSet
in interfaceLongSortedSet
-
subSet
- Specified by:
subSet
in interfaceLongSortedSet
-