Package org.yamcs.parameterarchive
Class BooleanValueSegment
- java.lang.Object
-
- org.yamcs.parameterarchive.BaseSegment
-
- org.yamcs.parameterarchive.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
-
-
Field Summary
-
Fields inherited from class org.yamcs.parameterarchive.BaseSegment
FORMAT_ID_BinaryValueSegment, FORMAT_ID_BooleanValueSegment, FORMAT_ID_DoubleValueSegment, FORMAT_ID_FloatValueSegment, FORMAT_ID_GenericValueSegment, FORMAT_ID_IntValueSegment, FORMAT_ID_LongValueSegment, FORMAT_ID_ParameterStatusSegment, FORMAT_ID_SortedTimeValueSegment, FORMAT_ID_StringValueSegment, formatId
-
-
Constructor Summary
Constructors Constructor Description BooleanValueSegment()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int pos, Value engValue)BaseSegmentconsolidate()intgetMaxSerializedSize()ValueArraygetRange(int posStart, int posStop, boolean ascending)returns an array containing the values in the range [posStart, posStop) if ascending or [posStop, posStart) if descendingValuegetValue(int index)returns Value at position indexstatic BooleanValueSegmentparseFrom(ByteBuffer bb)intsize()returns the size of the BitSet storing the values - this will round up to the size of longvoidwriteTo(ByteBuffer bb)write the segment to buffer-
Methods inherited from class org.yamcs.parameterarchive.BaseSegment
getFormatId, parseSegment
-
-
-
-
Method Detail
-
writeTo
public void writeTo(ByteBuffer bb)
write the segment to buffer- Specified by:
writeToin classBaseSegment- Parameters:
bb-
-
parseFrom
public static BooleanValueSegment parseFrom(ByteBuffer bb) throws DecodingException
- Throws:
DecodingException
-
getMaxSerializedSize
public int getMaxSerializedSize()
- Specified by:
getMaxSerializedSizein classBaseSegment- 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:ValueSegmentreturns Value at position index- Specified by:
getValuein interfaceValueSegment- Returns:
- the value at the index
-
getRange
public ValueArray getRange(int posStart, int posStop, boolean ascending)
Description copied from interface:ValueSegmentreturns an array containing the values in the range [posStart, posStop) if ascending or [posStop, posStart) if descending- Specified by:
getRangein interfaceValueSegment- 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:
sizein interfaceValueSegment- Specified by:
sizein classBaseSegment
-
add
public void add(int pos, Value engValue)- Specified by:
addin interfaceValueSegment
-
consolidate
public BaseSegment consolidate()
- Specified by:
consolidatein interfaceValueSegment
-
-