Class AbstractBit64Type<T extends AbstractBit64Type<T>>

  • All Implemented Interfaces:
    NativeType<T>, ValueEquals<T>, Type<T>
    Direct Known Subclasses:
    BasePairBitType, UnsignedVariableBitLengthType

    public abstract class AbstractBit64Type<T extends AbstractBit64Type<T>>
    extends AbstractBitType<T>
    A Type with arbitrary bit depth up to maximum 64 bits. The behavior beyond 64 bits is undefined. To set and get bits, we use longs. Therefore not more than 64 bits are supported. The long is not supposed to have anything to do with math, it is simply an efficient way to hold an array of bits The performance of this type is traded off for the gain in memory storage. The setBits(long) operation takes have the time as the getBits() operation. The performance may degrade very slightly with increasing bit depth, but the decrease is barely noticeable.
    Author:
    Albert Cardona, Stephan Preibisch
    • Constructor Detail

      • AbstractBit64Type

        public AbstractBit64Type​(NativeImg<?,​? extends LongAccess> bitStorage,
                                 int nBits)
      • AbstractBit64Type

        public AbstractBit64Type​(long value,
                                 int nBits)
      • AbstractBit64Type

        public AbstractBit64Type​(LongAccess access,
                                 int nBits)
      • AbstractBit64Type

        public AbstractBit64Type​(int nBits)
    • Method Detail

      • getBits

        protected long getBits()
        Writes the current "subLong" location of the LongAccess into the lower nBits bits of the long value Note that "long value" does not refer to math, it is just a way to help to return arbitrary values. It is basically an array of bits.
        Returns:
      • setBits

        protected void setBits​(long value)
        Sets the lower nBits bits of the long value into the current "subLong" location of the LongAccess Note that "long value" does not refer to math, it is just a way to help to set arbitrary values. It is basically an array of bits.
        Parameters:
        value -