|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<Boolean>
it.unimi.dsi.fastutil.booleans.AbstractBooleanCollection
it.unimi.dsi.fastutil.booleans.AbstractBooleanBigList
it.unimi.dsi.bits.AbstractBitVector
it.unimi.dsi.bits.BooleanListBitVector
public class BooleanListBitVector
A boolean-list based implementation of BitVector.
This implementation of a bit vector is based on a backing
list of booleans. It is rather inefficient, but useful for
wrapping purposes, for covering completely the code in
AbstractBitVector and for creating mock objects.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class it.unimi.dsi.bits.AbstractBitVector |
|---|
AbstractBitVector.LongBigListView, AbstractBitVector.LongSetView, AbstractBitVector.SubBitVector |
| Nested classes/interfaces inherited from class it.unimi.dsi.fastutil.booleans.AbstractBooleanBigList |
|---|
AbstractBooleanBigList.BooleanSubList |
| Constructor Summary | |
|---|---|
protected |
BooleanListBitVector(BooleanBigList list)
|
protected |
BooleanListBitVector(int capacity)
|
| Method Summary | |
|---|---|
void |
add(long index,
boolean value)
Adds a bit with specified value at the specified index (optional operation). |
BooleanListBitVector |
copy()
Returns a copy of this bit vector. |
BooleanListBitVector |
copy(long from,
long to)
Returns a copy of a part of this bit vector. |
BitVector |
ensureCapacity(long numBits)
|
protected static void |
ensureIntegerIndex(long index)
|
boolean |
getBoolean(long index)
Returns the value of the specified bit. |
static BooleanListBitVector |
getInstance()
Creates a new empty bit vector. |
static BooleanListBitVector |
getInstance(long capacity)
|
long |
length()
Returns the number of bits in this bit vector. |
BitVector |
length(long numBits)
Sets the number of bits in this bit vector. |
static BooleanListBitVector |
of(int... bit)
Creates a new bit vector with given bits. |
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). |
static BooleanListBitVector |
wrap(BooleanBigList list)
|
static BooleanListBitVector |
wrap(BooleanList list)
|
| Methods inherited from class it.unimi.dsi.bits.AbstractBitVector |
|---|
add, add, add, add, and, append, append, asLongBigList, asLongSet, bits, clear, clear, clear, compareTo, compareTo, count, ensureIndex, ensureRestrictedIndex, equals, equals, fast, fill, fill, fill, fill, firstOne, firstZero, flip, flip, flip, flip, getBoolean, getInt, getLong, hashCode, isPrefix, isProperPrefix, lastOne, lastZero, longestCommonPrefixLength, nextOne, nextZero, or, previousOne, previousZero, removeBoolean, replace, set, set, set, set, size, size, size, size64, subList, subVector, subVector, toString, xor |
| Methods inherited from class it.unimi.dsi.fastutil.booleans.AbstractBooleanBigList |
|---|
add, addAll, addAll, addAll, addAll, addAll, addAll, addAll, addElements, addElements, contains, get, getElements, indexOf, indexOf, iterator, lastIndexOf, lastIndexOf, listIterator, listIterator, listIterator, peek, peekBoolean, pop, popBoolean, push, push, rem, remove, remove, removeElements, set, subList, top, topBoolean |
| Methods inherited from class it.unimi.dsi.fastutil.booleans.AbstractBooleanCollection |
|---|
add, booleanIterator, contains, containsAll, containsAll, isEmpty, rem, remove, removeAll, removeAll, retainAll, retainAll, toArray, toArray, toArray, toBooleanArray, toBooleanArray |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface it.unimi.dsi.fastutil.booleans.BooleanBigList |
|---|
addAll, addAll, addAll, addElements, addElements, getElements, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeElements, subList |
| Methods inherited from interface it.unimi.dsi.fastutil.BigList |
|---|
add, addAll, get, indexOf, lastIndexOf, remove, set |
| Methods inherited from interface it.unimi.dsi.fastutil.booleans.BooleanCollection |
|---|
addAll, booleanIterator, contains, containsAll, rem, removeAll, retainAll, toArray, toArray, toBooleanArray, toBooleanArray |
| Methods inherited from interface java.util.Collection |
|---|
add, addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray |
| Methods inherited from interface it.unimi.dsi.fastutil.Stack |
|---|
isEmpty |
| Constructor Detail |
|---|
protected BooleanListBitVector(BooleanBigList list)
protected BooleanListBitVector(int capacity)
| Method Detail |
|---|
protected static final void ensureIntegerIndex(long index)
public static BooleanListBitVector getInstance(long capacity)
public static BooleanListBitVector getInstance()
public static BooleanListBitVector of(int... bit)
public static BooleanListBitVector wrap(BooleanList list)
public static BooleanListBitVector wrap(BooleanBigList list)
public long length()
BitVectorIf the number of bits in this vector is smaller than or equal to Integer.MAX_VALUE, this
method is semantically equivalent to List.size(). In any case, this method is semantically
equivalent to Size64.size64().
length in interface BitVector
public boolean set(long index,
boolean value)
BitVectorThis method is semantically equivalent to BooleanList.set(int,boolean),
but it gives access to long indices.
set in interface BitVectorset in interface BooleanBigListset in class AbstractBitVectorindex - the index of a bit.value - the new value.public boolean getBoolean(long index)
BitVectorThis method is semantically equivalent to BooleanList.getBoolean(int),
but it gives access to long indices.
getBoolean in interface BitVectorgetBoolean in interface BooleanBigListindex - the index of a bit.
public void add(long index,
boolean value)
BitVectorThis method is semantically equivalent to BooleanList.add(int,boolean),
but it gives access to long indices.
add in interface BitVectoradd in interface BooleanBigListadd in class AbstractBitVectorindex - the index of a bit.value - the value that will be inserted at position index.public boolean removeBoolean(long index)
BitVectorThis method is semantically equivalent to BooleanList.removeBoolean(int),
but it gives access to long indices.
removeBoolean in interface BitVectorremoveBoolean in interface BooleanBigListremoveBoolean in class AbstractBitVectorindex - the index of a bit.
public BooleanListBitVector copy(long from,
long to)
BitVector
copy in interface BitVectorcopy in class AbstractBitVectorfrom - the starting bit, inclusive.to - the ending bit, not inclusive.
from (inclusive) to bit to
(not inclusive)public BooleanListBitVector copy()
BitVector
copy in interface BitVectorcopy in class AbstractBitVectorpublic BitVector ensureCapacity(long numBits)
public BitVector length(long numBits)
BitVectorIt is expected that this method will try to allocate exactly the necessary space.
If the number of bits in this vector is smaller than
or equal to Integer.MAX_VALUE, this
method is semantically equivalent to BooleanList.size(int). In any case, this method is semantically
essentially equivalent to BigList.size(long).
length in interface BitVectorlength in class AbstractBitVector
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||