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 TypeMethodDescriptionbooleanaddBit(boolean bit) Appends a bit to this bit vector.booleanReturnstrueif and only if the specified object is also a BitVector and both contain the same bits in the same order.booleangetBit(long position) This is the "access" method of bit vectors.iterator()voidsetBit(long position, boolean bit) Sets a bit at a particular position.longsize()
-
Method Details
-
equals
Returnstrueif 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:
trueif 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
-