Class BitField

  • All Implemented Interfaces:
    java.io.Serializable

    public final class BitField
    extends java.lang.Object
    implements java.io.Serializable
    This class manages huge bit fields. It is much faster than BitSet and was specifically developed to be used with huge bit sets in ISnapshot (e.g. needed in virtual GC traces). Out of performance reasons no method does any parameter checking, i.e. only valid values are expected.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      BitField​(int size)
      Creates a bit field with the given number of bits.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear​(int index)
      Clears the bit on the given index.
      boolean get​(int index)
      Gets the bit on the given index.
      void set​(int index)
      Sets the bit on the given index.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BitField

        public BitField​(int size)
        Creates a bit field with the given number of bits. Size is expected to be positive - out of performance reasons no checks are done!
        Parameters:
        size - the maximum size of the BitField
    • Method Detail

      • set

        public final void set​(int index)
        Sets the bit on the given index. Index is expected to be in range - out of performance reasons no checks are done!
        Parameters:
        index - The 0-based index into the BitField.
      • clear

        public final void clear​(int index)
        Clears the bit on the given index. Index is expected to be in range - out of performance reasons no checks are done!
        Parameters:
        index - The 0-based index into the BitField.
      • get

        public final boolean get​(int index)
        Gets the bit on the given index. Index is expected to be in range - out of performance reasons no checks are done!
        Parameters:
        index - The 0-based index into the BitField.
        Returns:
        true if the BitField was set, false if it was cleared or never set.