public static class AbstractBitVector.SubBitVector extends AbstractBitVector implements BitVector
AbstractBitVector.LongBigListView, AbstractBitVector.LongSetView, AbstractBitVector.SubBitVector
Modifier and Type | Field and Description |
---|---|
protected BitVector |
bitVector |
protected long |
from |
protected long |
to |
Constructor and Description |
---|
AbstractBitVector.SubBitVector(BitVector l,
long from,
long to) |
Modifier and Type | Method and Description |
---|---|
void |
add(int value)
Adds a bit with specified value at the end of this bit vector.
|
void |
add(long index,
boolean value)
Adds a bit with specified value at the specified index (optional operation).
|
void |
add(long index,
int value)
Adds a bit with specified integer value at the specified index (optional operation).
|
BitVector |
copy(long from,
long to)
Returns a copy of a part of this bit vector.
|
boolean |
getBoolean(long index)
Returns the value of the specified bit.
|
int |
getInt(long index)
Returns the value of the specified bit as an integer.
|
long |
getLong(long from,
long to)
Returns the specified bit range as a long.
|
long |
length()
Returns the number of bits in this bit vector.
|
boolean |
removeBoolean(long index)
Removes a bit with specified index (optional operation).
|
boolean |
set(long index,
boolean value)
Sets the value of the specified bit (optional operation).
|
void |
set(long index,
int value)
Sets the value of the specified bit as an integer (optional operation).
|
BitVector |
subVector(long from,
long to)
Returns a subvector view specified by initial and final index.
|
add, add, and, append, append, asLongBigList, asLongSet, bits, clear, clear, clear, compareTo, compareTo, copy, count, ensureIndex, ensureRestrictedIndex, equals, fast, fill, fill, fill, fill, firstOne, firstZero, flip, flip, flip, flip, getBoolean, hashCode, lastOne, lastZero, length, longestCommonPrefixLength, nextOne, nextZero, or, previousOne, previousZero, removeBoolean, replace, set, set, set, size, size, subList, subVector, toString, xor
add, addAll, addAll, addAll, addAll, addAll, addAll, addElements, addElements, booleanListIterator, booleanListIterator, booleanSubList, contains, ensureIndex, ensureRestrictedIndex, get, getElements, indexOf, indexOf, iterator, lastIndexOf, lastIndexOf, listIterator, listIterator, peek, peekBoolean, pop, popBoolean, push, push, rem, remove, remove, removeElements, set, top, topBoolean
add, booleanIterator, contains, containsAll, containsAll, isEmpty, rem, removeAll, removeAll, retainAll, retainAll, toArray, toArray, toArray, toBooleanArray, toBooleanArray
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
and, append, append, asLongBigList, asLongSet, bits, clear, copy, count, fast, fill, fill, fill, fill, firstOne, firstZero, flip, flip, flip, hashCode, lastOne, lastZero, length, longestCommonPrefixLength, nextOne, nextZero, or, previousOne, previousZero, replace, set, subVector, xor
add, add, addAll, addAll, addAll, addElements, addElements, booleanListIterator, booleanListIterator, booleanSubList, getBoolean, getElements, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeBoolean, removeElements, set, size, subList
add, add, addAll, addAll, clear, contains, containsAll, equals, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeAll, retainAll, set, size, toArray, toArray
compareTo
protected final BitVector bitVector
protected long from
protected long to
public AbstractBitVector.SubBitVector(BitVector l, long from, long to)
public boolean getBoolean(long index)
BitVector
This method is semantically equivalent to BooleanList.getBoolean(int)
,
but it gives access to long indices.
getBoolean
in interface BitVector
index
- the index of a bit.public int getInt(long index)
BitVector
This method is a useful synonym for BitVector.getBoolean(long)
.
getInt
in interface BitVector
getInt
in class AbstractBitVector
index
- the index of a bit.public boolean set(long index, boolean value)
BitVector
This method is semantically equivalent to BooleanList.set(int,boolean)
,
but it gives access to long indices.
set
in interface BitVector
set
in class AbstractBitVector
index
- the index of a bit.value
- the new value.public void set(long index, int value)
BitVector
This method is a useful synonym for BitVector.set(long, boolean)
.
set
in interface BitVector
set
in class AbstractBitVector
index
- the index of a bit.value
- the new value (any nonzero integer for setting the bit, zero for clearing the bit).public void add(long index, boolean value)
BitVector
This method is semantically equivalent to BooleanList.add(int,boolean)
,
but it gives access to long indices.
add
in interface BitVector
add
in class AbstractBitVector
index
- the index of a bit.value
- the value that will be inserted at position index
.public void add(long index, int value)
BitVector
This method is a useful synonym for BitVector.add(long, boolean)
.
add
in interface BitVector
add
in class AbstractBitVector
index
- the index of a bit.value
- the value that will be inserted at position index
(any nonzero integer for a true bit, zero for a false bit).public void add(int value)
BitVector
This method is a useful synonym for BooleanList.add(boolean)
.
add
in interface BitVector
add
in class AbstractBitVector
value
- the new value (any nonzero integer for a true bit, zero for a false bit).public boolean removeBoolean(long index)
BitVector
This method is semantically equivalent to BooleanList.removeBoolean(int)
,
but it gives access to long indices.
removeBoolean
in interface BitVector
removeBoolean
in class AbstractBitVector
index
- the index of a bit.public BitVector copy(long from, long to)
BitVector
copy
in interface BitVector
copy
in class AbstractBitVector
from
- the starting bit, inclusive.to
- the ending bit, not inclusive.from
(inclusive) to bit to
(not inclusive)public BitVector subVector(long from, long to)
BitVector
The object returned by this method is a bit vector representing a view of this bit vector restricted to the given indices. Changes to the subvector will be reflected in the main vector.
subVector
in interface BitVector
subVector
in class AbstractBitVector
from
- the first index (inclusive).to
- the last index (not inclusive).public long getLong(long from, long to)
BitVector
Note that bit 0 of the returned long will be bit from
of this bit vector.
Implementations are invited to provide high-speed implementations for
the case in which from
is a multiple of Long.SIZE
and to
is from
+ Long.SIZE
(or less,
in case the vector length is exceeded). This behaviour make it possible to
implement high-speed hashing, copies, etc.
getLong
in interface BitVector
getLong
in class AbstractBitVector
from
- the starting bit (inclusive).to
- the ending bit (exclusive).public long length()
BitVector
If the number of bits in this vector is smaller than or equal to Integer.MAX_VALUE
, this
method is semantically equivalent to List.size()
.
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.