public final class BooleanBitmap
extends java.lang.Object
BooleanBitmap is a bitmap, or array, of boolean
 values.  This helps to reduce the size of the array to a single bit
 per entry rather than 1 byte per entry at the expense of extra
 overhead to access the information. 
 Note that the bitmap does not expand automatically when you access
 an entry beyond the end of the bitmap - you must explicitly expand
 the bitmap using setSize().  Also note that if you
 do not provide a boolean fill value to use for initialization,
 all (new) entries will be left uninitialized when the bitmap is
 created or expanded. 
| Constructor and Description | 
|---|
BooleanBitmap(int initialSize)
Constructs a new  
BooleanBitmap with the given
 size, with no automatic initialization performed. | 
BooleanBitmap(int initialSize,
             boolean defaultFill)
Constructs a new  
BooleanBitmap with the given
 size, with automatic initialization to the given fill value. | 
| Modifier and Type | Method and Description | 
|---|---|
boolean | 
get(int index)
Fetches the boolean value in the bitmap at the given index, which
 is 0-based. 
 | 
int | 
getSize()
Fetches the size of the  
BooleanBitmap in terms of
 the number of entries it holds. | 
void | 
set(int index,
   boolean newValue)
Sets the boolean value in the bitmap at the given index, which
 is 0-based. 
 | 
void | 
setSize(int requestedSize)
Sets the size of the  
BooleanBitmap to the given
 specified user size. | 
java.lang.String | 
toString()
Fetch the boolean values of this bitmap as a sequence of 0's
 and 1's, starting with the 0 offset on the very left. 
 | 
public BooleanBitmap(int initialSize)
BooleanBitmap with the given
 size, with no automatic initialization performed.  If you
 need the Bitmap to ensure that all entries are initialized
 to some fill value before use, you must use the alternate
 constructor call and specify the fill value.initialSize - the size of the bitmap in boolean entriesdefaultFill - the user's default fill to usepublic BooleanBitmap(int initialSize,
             boolean defaultFill)
BooleanBitmap with the given
 size, with automatic initialization to the given fill value.initialSize - the size of the bitmap in boolean entriesdefaultFill - the user's default fill to usepublic int getSize()
BooleanBitmap in terms of
 the number of entries it holds.  The size of the bitmap is
 determined by the initial size of the bitmap (if it is newly
 created) or by the last call to setSize().return - the size of the bitmap in entriespublic void setSize(int requestedSize)
BooleanBitmap to the given
 specified user size.  The bitmap will be expanded (with
 additional data values initialized to the given fill), or shrunk
 depending on requestedSize.requestedSize - the new size of the bitmappublic boolean get(int index)
            throws java.lang.IndexOutOfBoundsException
getSize()
 entries, so this index should be from 0 to
 getSize()-1.  If the index is beyond the size of
 the bitmap, an IndexOutOfBoundsException will be thrown.index - the index of the boolean value to getthrows - an IndexOutOfBoundsException if the index is
            not within the proper range of the bitmapjava.lang.IndexOutOfBoundsExceptionpublic void set(int index,
       boolean newValue)
getSize()
 entries, so this index should be from 0 to
 getSize()-1.  If the index is beyond the size of
 the bitmap, an IndexOutOfBoundsException will be thrown.index - the index of the boolean value to setnewValue - the new value to set at the given indexthrows - an IndexOutOfBoundsException if the index is
            not within the proper range of the bitmappublic java.lang.String toString()
toString in class java.lang.Object