Package it.unimi.dsi.bits
Class AbstractBitVector.LongSetView
- java.lang.Object
-
- java.util.AbstractCollection<java.lang.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,java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<java.lang.Long>,java.util.Collection<java.lang.Long>,java.util.Set<java.lang.Long>,java.util.SortedSet<java.lang.Long>
- Enclosing class:
- AbstractBitVector
public static class AbstractBitVector.LongSetView extends it.unimi.dsi.fastutil.longs.AbstractLongSortedSet implements it.unimi.dsi.fastutil.longs.LongSet, java.io.Serializable, it.unimi.dsi.fastutil.Size64A 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 andadd(long)will cause anUnsupportedOperationException.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LongSetView(BitVector bitVector, long from, long to)Creates a new view on a subvector.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanadd(long index)voidclear()it.unimi.dsi.fastutil.longs.LongComparatorcomparator()booleancontains(long index)longfirstLong()it.unimi.dsi.fastutil.longs.LongSortedSetheadSet(long to)it.unimi.dsi.fastutil.longs.LongBidirectionalIteratoriterator()it.unimi.dsi.fastutil.longs.LongBidirectionalIteratoriterator(long from)longlastLong()booleanremove(long index)intsize()Deprecated.longsize64()it.unimi.dsi.fastutil.longs.LongSortedSetsubSet(long from, long to)it.unimi.dsi.fastutil.longs.LongSortedSettailSet(long from)-
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.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
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
-
-
-
-
Field Detail
-
bitVector
protected final BitVector bitVector
The underlying bit vector.
-
-
Constructor Detail
-
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 Detail
-
contains
public boolean contains(long index)
- Specified by:
containsin interfaceit.unimi.dsi.fastutil.longs.LongCollection- Overrides:
containsin classit.unimi.dsi.fastutil.longs.AbstractLongCollection
-
add
public boolean add(long index)
- Specified by:
addin interfaceit.unimi.dsi.fastutil.longs.LongCollection- Overrides:
addin classit.unimi.dsi.fastutil.longs.AbstractLongCollection
-
remove
public boolean remove(long index)
- Specified by:
removein interfaceit.unimi.dsi.fastutil.longs.LongSet- Overrides:
removein classit.unimi.dsi.fastutil.longs.AbstractLongSet
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Collection<java.lang.Long>- Specified by:
clearin interfacejava.util.Set<java.lang.Long>- Overrides:
clearin classjava.util.AbstractCollection<java.lang.Long>
-
size64
public long size64()
- Specified by:
size64in interfaceit.unimi.dsi.fastutil.Size64
-
size
@Deprecated public int size()
Deprecated.- Specified by:
sizein interfacejava.util.Collection<java.lang.Long>- Specified by:
sizein interfacejava.util.Set<java.lang.Long>- Specified by:
sizein interfaceit.unimi.dsi.fastutil.Size64- Specified by:
sizein classjava.util.AbstractCollection<java.lang.Long>
-
iterator
public it.unimi.dsi.fastutil.longs.LongBidirectionalIterator iterator()
- Specified by:
iteratorin interfacejava.util.Collection<java.lang.Long>- Specified by:
iteratorin interfacejava.lang.Iterable<java.lang.Long>- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.longs.LongBidirectionalIterable- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.longs.LongCollection- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.longs.LongIterable- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.longs.LongSet- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.longs.LongSortedSet- Specified by:
iteratorin interfacejava.util.Set<java.lang.Long>- Specified by:
iteratorin classit.unimi.dsi.fastutil.longs.AbstractLongSortedSet
-
iterator
public it.unimi.dsi.fastutil.longs.LongBidirectionalIterator iterator(long from)
- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.longs.LongSortedSet
-
firstLong
public long firstLong()
- Specified by:
firstLongin interfaceit.unimi.dsi.fastutil.longs.LongSortedSet
-
lastLong
public long lastLong()
- Specified by:
lastLongin interfaceit.unimi.dsi.fastutil.longs.LongSortedSet
-
comparator
public it.unimi.dsi.fastutil.longs.LongComparator comparator()
- Specified by:
comparatorin interfaceit.unimi.dsi.fastutil.longs.LongSortedSet- Specified by:
comparatorin interfacejava.util.SortedSet<java.lang.Long>
-
headSet
public it.unimi.dsi.fastutil.longs.LongSortedSet headSet(long to)
- Specified by:
headSetin interfaceit.unimi.dsi.fastutil.longs.LongSortedSet
-
tailSet
public it.unimi.dsi.fastutil.longs.LongSortedSet tailSet(long from)
- Specified by:
tailSetin interfaceit.unimi.dsi.fastutil.longs.LongSortedSet
-
subSet
public it.unimi.dsi.fastutil.longs.LongSortedSet subSet(long from, long to)- Specified by:
subSetin interfaceit.unimi.dsi.fastutil.longs.LongSortedSet
-
-