Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.utils.io
Class Bitmap

    java.lang.Object
      oracle.ifs.utils.io.Bitmap

    public class Bitmap

extends java.lang.Object

The Bitmap class is a wrapper for byte arrays. It includes methods that deal with individual bits. Bits are numbered in network byte order (most significant bit first). That is, bit 0 is the rightmost bit in the last index of the byte array that makes up the BitMap.

Modified:
  lsaenz 07/12/2001 Add allBitsCleared, allBitsSet., lsaenz 01/19/2001 Added method: isBitSet., lsaenz 01/10/2001 Created.

Field Summary
`protected byte[]` | `m_bitmap` The underlying byte array.

Constructor Summary
`Bitmap(byte[] data)` Creates a new Bitmap.
`Bitmap(int length)` Creates a new Bitmap.

Method Summary
`boolean` | `allBitsCleared()` Returns true if all of the bits in this Bitmap are cleared (0).
`boolean` | `allBitsSet()` Returns true if all of the bits in this Bitmap are set (1).
`void` | `clearBit(int bit)` Clears a specific bit in this Bitmap.
`byte[]` | `getBytes()` Returns a reference to this Bitmap's data.
`boolean` | `isBitSet(int bit)` Returns true if a specific bit is set in this Bitmap.
`int` | `length()` Returns the length of this Bitmap.
`static void` | `main(java.lang.String[] args)` Tests this class.
`void` | `setBit(int bit)` Sets a specific bit in this Bitmap.
`void` | `setBits(int value, int offset, int length)` Sets a subset of this Bitmap to a given value.
`void` | `setByte(int index, byte value)` Sets a byte in this Bitmap's data.
`long` | `toLong()` Returns the long value of this Bitmap.
`long` | `toLong(int offset, int length)` Returns the long value of this Bitmap.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### m_bitmap

    protected byte[] m_bitmap

  Description copied from class: `Bitmap`
  The underlying byte array.

Constructor Detail

### Bitmap

    public Bitmap(int length)

  Creates a new Bitmap.

  Parameters:
    `length` - the length (in bytes).

### Bitmap

    public Bitmap(byte[] data)

  Creates a new Bitmap.

  Parameters:
    `data` - the byte array to use for this Bitmap's underlying data.

Method Detail

### main

    public static void main(java.lang.String[] args)

  Description copied from class: `Bitmap`
  Tests this class.

### allBitsCleared

    public boolean allBitsCleared()

  Description copied from class: `Bitmap`
  Returns true if all of the bits in this Bitmap are cleared (0).

### allBitsSet

    public boolean allBitsSet()

  Description copied from class: `Bitmap`
  Returns true if all of the bits in this Bitmap are set (1).

### getBytes

    public byte[] getBytes()

  Description copied from class: `Bitmap`
  Returns a reference to this Bitmap's data.

  Returns:
    a reference to this Bitmap's underlying byte array.

### length

    public int length()

  Description copied from class: `Bitmap`
  Returns the length of this Bitmap.

  Returns:
    the length (in bytes) of this Bitmap.

### toLong

    public long toLong()

  Description copied from class: `Bitmap`
  Returns the long value of this Bitmap.

  Returns:
    a long representation of this Bitmap.

### toLong

    public long toLong(int offset,
                       int length)

  Description copied from class: `Bitmap`
  Returns the long value of this Bitmap.

  Parameters:
    `offset` - the offset of the value in this Bitmap.
    `length` - the length (in bytes) of the value.
  Returns:
    a long representation of the specified subset of this Bitmap.
  Throws:
    `java.lang.ArrayIndexOutOfBoundsException` - if `offset > this.length() - 1` or `length > this.length() - 1 - offset` or `offset < 0`

### setByte

    public void setByte(int index,
                        byte value)

  Description copied from class: `Bitmap`
  Sets a byte in this Bitmap's data.

  Parameters:
    `index` - the index of this Bitmap's data whose value to set.
    `value` - the byte value to set.

### setBit

    public void setBit(int bit)

  Description copied from class: `Bitmap`
  Sets a specific bit in this Bitmap.

  Parameters:
    `bit` - the bit to set: between `0..this.length() - 1`.
  Throws:
    `java.lang.ArrayIndexOutOfBoundsException` - if `bit > buffer.length - 1`

### clearBit

    public void clearBit(int bit)

  Description copied from class: `Bitmap`
  Clears a specific bit in this Bitmap.

  Parameters:
    `bit` - the bit to set: between `0..this.length() - 1`.
  Throws:
    `java.lang.ArrayIndexOutOfBoundsException` - if `bit > buffer.length - 1`

### isBitSet

    public boolean isBitSet(int bit)

  Description copied from class: `Bitmap`
  Returns true if a specific bit is set in this Bitmap.

  Parameters:
    `bit` - the bit to check: between `0..this.length() - 1`.
  Returns:
    true if the bit is set.

### setBits

    public void setBits(int value,
                        int offset,
                        int length)

  Description copied from class: `Bitmap`
  Sets a subset of this Bitmap to a given value.

  Parameters:
    `value` - the int value to set.
    `offset` - the bit offset (from the left) where the value will begin.
    `length` - the length (in bits) of the value.
    Note: if `length > 32`, this method will set `length` to 32 (int values are 32 bits long).

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD