com.timeindexing.util
Class MassiveBitSet

java.lang.Object
  extended bycom.timeindexing.util.MassiveBitSet

public class MassiveBitSet
extends java.lang.Object

A MassiveBitSet is used for appplications where a massive BitSet is required. It is based on java.util.BitSet, but rather than resizing and copying an existing BitSet it uses a DoubleLinkedList of fixed size BitSets.


Constructor Summary
MassiveBitSet()
          Construct a MassiveBitSet
MassiveBitSet(long n)
          Construct a MassiveBitSet
 
Method Summary
protected  MassiveBitSet allocate(long n)
          Allocate enough space to hold up to n bits.
 MassiveBitSet clear()
          Clear all of the MassiveBitSet.
 MassiveBitSet clear(long n)
          Clear the value of the nth bit.
 boolean get(long n)
          Get the value of the nth bit.
 long highest()
          Return the highest bit position to be set.
 MassiveBitSet reset()
          This resets the MassiveBitSet by clearing all of the bits, and setting the highest back to zero.
 MassiveBitSet set(long n)
          Set the value of the nth bit.
 MassiveBitSet set(long n, boolean value)
          Set the value of the nth bit.
 long size()
          Get the no of bits that can be currently stored in this MassiveBitSet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MassiveBitSet

public MassiveBitSet()
Construct a MassiveBitSet


MassiveBitSet

public MassiveBitSet(long n)
Construct a MassiveBitSet

Parameters:
n - the no of bits to pre-allocate
Method Detail

size

public long size()
Get the no of bits that can be currently stored in this MassiveBitSet.


get

public boolean get(long n)
Get the value of the nth bit.

Parameters:
n - the bit to get

clear

public MassiveBitSet clear(long n)
Clear the value of the nth bit.

Parameters:
n - the bit to get

clear

public MassiveBitSet clear()
Clear all of the MassiveBitSet.


reset

public MassiveBitSet reset()
This resets the MassiveBitSet by clearing all of the bits, and setting the highest back to zero.


set

public MassiveBitSet set(long n)
Set the value of the nth bit.

Parameters:
n - the bit to get

set

public MassiveBitSet set(long n,
                         boolean value)
Set the value of the nth bit.

Parameters:
n - the bit to get
value - the value to set bit n to

highest

public long highest()
Return the highest bit position to be set.


allocate

protected MassiveBitSet allocate(long n)
Allocate enough space to hold up to n bits.