Interface BitVector
- All Known Subinterfaces:
RankedBitVector
- All Known Implementing Classes:
BitVectorImpl
,RankedBitVectorImpl
public interface BitVector
Interface for a bit vector.
- Author:
- Julian Mendez
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addBit
(boolean bit) Appends a bit to this bit vector.boolean
Returnstrue
if and only if the specified object is also a BitVector and both contain the same bits in the same order.boolean
getBit
(long position) This is the "access" method of bit vectors.iterator()
void
setBit
(long position, boolean bit) Sets a bit at a particular position.long
size()
-
Method Details
-
equals
Returnstrue
if and only if the specified object is also a BitVector and both contain the same bits in the same order. -
getBit
boolean getBit(long position) This is the "access" method of bit vectors.- Returns:
- value of a bit at position
- Throws:
IndexOutOfBoundsException
- if the position is out of range
-
size
long size()- Returns:
- size of this bit vector
-
iterator
- Returns:
- an iterator for this bit vector
-
addBit
boolean addBit(boolean bit) Appends a bit to this bit vector.- Returns:
true
if the element was successfully added
-
setBit
void setBit(long position, boolean bit) Sets a bit at a particular position.- Parameters:
position
- positionbit
- bit- Throws:
IndexOutOfBoundsException
- if the position is out of range
-