|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.zxing.common.BitArray
public final class BitArray
A simple, fast array of bits, represented compactly by an array of ints internally.
Field Summary | ||
---|---|---|
int[] |
bits
|
|
int |
size
|
Constructor Summary | ||
---|---|---|
BitArray(int size)
|
Method Summary | ||
---|---|---|
void |
clear()
Clears all bits (sets to false). |
|
void |
flip(int i)
Flips bit i. |
|
boolean |
get(int i)
|
|
int[] |
getBitArray()
|
|
int |
getSize()
|
|
boolean |
isRange(int start,
int end,
boolean value)
Efficient method to check if a range of bits is set, or not set. |
|
void |
reverse()
Reverses all bits in the array. |
|
void |
set(int i)
Sets bit i. |
|
void |
setBulk(int i,
int newBits)
Sets a block of 32 bits, starting at bit i. |
|
String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int[] bits
public final int size
Constructor Detail |
---|
public BitArray(int size)
Method Detail |
---|
public int getSize()
public boolean get(int i)
i
- bit to get
public void set(int i)
i
- bit to setpublic void flip(int i)
i
- bit to setpublic void setBulk(int i, int newBits)
i
- first bit to setnewBits
- the new value of the next 32 bits. Note again that the least-significant bit
corresponds to bit i, the next-least-significant to i+1, and so on.public void clear()
public boolean isRange(int start, int end, boolean value)
start
- start of range, inclusive.end
- end of range, exclusivevalue
- if true, checks that bits in range are set, otherwise checks that they are not set
IllegalArgumentException
- if end is less than or equal to startpublic int[] getBitArray()
public void reverse()
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.