Class BooleanValueSegment

  • All Implemented Interfaces:
    ValueSegment

    public class BooleanValueSegment
    extends BaseSegment
    implements ValueSegment
    Boolean value sgement uses BitSet to represent the boolean values as a set of bits
    • Constructor Detail

      • BooleanValueSegment

        public BooleanValueSegment()
    • Method Detail

      • writeTo

        public void writeTo​(ByteBuffer bb)
        write the segment to buffer
        Specified by:
        writeTo in class BaseSegment
        Parameters:
        bb -
      • getMaxSerializedSize

        public int getMaxSerializedSize()
        Specified by:
        getMaxSerializedSize in class BaseSegment
        Returns:
        a high approximation for the serialized size in order to allocate a ByteBuffer big enough
      • getValue

        public Value getValue​(int index)
        Description copied from interface: ValueSegment
        returns Value at position index
        Specified by:
        getValue in interface ValueSegment
        Returns:
        the value at the index
      • getRange

        public ValueArray getRange​(int posStart,
                                   int posStop,
                                   boolean ascending)
        Description copied from interface: ValueSegment
        returns an array containing the values in the range [posStart, posStop) if ascending or [posStop, posStart) if descending
        Specified by:
        getRange in interface ValueSegment
        Returns:
        an array containing the values in the specified range
      • size

        public int size()
        returns the size of the BitSet storing the values - this will round up to the size of long
        Specified by:
        size in interface ValueSegment
        Specified by:
        size in class BaseSegment