|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecta3.BitVector
public class BitVector
An efficient implementation of an extensible array of bits. Based on
BitSet
, but provides an interface more like
ArrayList
or Vector
.
Constructor Summary | |
---|---|
BitVector()
Constructs a BitSet with no elements. |
Method Summary | |
---|---|
void |
add(boolean value)
Adds a new bit to the end of the BitVector . |
BitVector |
clone()
Returns an independent deep copy of this BitVector . |
boolean |
get(int index)
Returns the bit at index index . |
java.util.Iterator<java.lang.Boolean> |
iterator()
Returns an iterator over this BitVector . |
void |
set(int index,
boolean value)
Sets the bit at index index to the specified value . |
int |
size()
Returns the size (number of bits) in this BitVector . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BitVector()
BitSet
with no elements.
Method Detail |
---|
public void set(int index, boolean value) throws java.lang.ArrayIndexOutOfBoundsException
index
to the specified value
. The
index
parameter must be at least 0 and less than size()
.
index
- index of the bit to setvalue
- boolean value to set it to
java.lang.ArrayIndexOutOfBoundsException
- if index
is out of boundspublic boolean get(int index) throws java.lang.ArrayIndexOutOfBoundsException
index
. The index
parameter must
be at least 0 and less than size()
.
index
- index of the bit to get
index
java.lang.ArrayIndexOutOfBoundsException
- if index
is out of boundspublic int size()
BitVector
.
BitVector
public void add(boolean value)
BitVector
.
value
- the value of the bit to addpublic java.util.Iterator<java.lang.Boolean> iterator()
BitVector
.
iterator
in interface java.lang.Iterable<java.lang.Boolean>
BitVector
Iterator
public BitVector clone()
BitVector
.
clone
in class java.lang.Object
BitVector
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |