public class

Bitmap

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.collect.Bitmap

Class Overview

A fast, efficient bitmap making optimal use of memory.

Summary

Public Constructors
Bitmap(int bitsize)
Public Methods
void addAllFrom(Bitmap other)
Add the values of a source bitmap into this bitmap.
void clear()
Clear the bitmap to all false.
Bitmap clone()
int countOnes()
Count the number of true values in the bitmap.
int countZeros()
Count the number of false values in the bitmap.
boolean equals(Object obj)
String formatAsRanges(boolean useExcludedEnds)
String formatAsRanges()
boolean get(int i)
Retrieve the value of a bit.
int hashCode()
boolean isEmpty()
Determine whether all entries in the bitmap are set to false.
boolean isFull()
Determine whether all entries in the bitmap are set to true.
List<Integer> ones()
Generate a list of zero-based indices for the bitmap entry is true.
void removeAllFrom(Bitmap other)
Remove the values of a source bitmap into this bitmap.
void reset(int i)
Fast reset a bit to false.
void set(int i)
Fast set a bit to true.
boolean set(int i, boolean v)
Set a bit to the provided value.
void setRange(int from, int to)
Fast set multiple bits to true.
int size()
Retrieve the map size.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Bitmap (int bitsize)

Public Methods

public void addAllFrom (Bitmap other)

Add the values of a source bitmap into this bitmap. Both bitmaps must have the same size.

Parameters
other source bitmap

public void clear ()

Clear the bitmap to all false.

public Bitmap clone ()

public int countOnes ()

Count the number of true values in the bitmap.

public int countZeros ()

Count the number of false values in the bitmap.

public boolean equals (Object obj)

public String formatAsRanges (boolean useExcludedEnds)

public String formatAsRanges ()

public boolean get (int i)

Retrieve the value of a bit.

Parameters
i zero-based index
Returns
  • the current bit value

public int hashCode ()

public boolean isEmpty ()

Determine whether all entries in the bitmap are set to false.

public boolean isFull ()

Determine whether all entries in the bitmap are set to true.

public List<Integer> ones ()

Generate a list of zero-based indices for the bitmap entry is true.

Returns
  • a list of integers

public void removeAllFrom (Bitmap other)

Remove the values of a source bitmap into this bitmap. Both bitmaps must have the same size.

Parameters
other source bitmap

public void reset (int i)

Fast reset a bit to false.

Parameters
i zero-based index

public void set (int i)

Fast set a bit to true.

Parameters
i zero-based index

public boolean set (int i, boolean v)

Set a bit to the provided value.

Parameters
i zero-based index
v value
Returns
  • true if the value was updated; false if it was unchanged

public void setRange (int from, int to)

Fast set multiple bits to true.

Parameters
from start zero-based index (inclusive)
to end zero-based index (exclusive)

public int size ()

Retrieve the map size.

public String toString ()