Package org.yamcs.parameterarchive
Class ObjectSegment<E>
java.lang.Object
org.yamcs.parameterarchive.BaseSegment
org.yamcs.parameterarchive.ObjectSegment<E>
- Direct Known Subclasses:
BinaryValueSegment
,ParameterStatusSegment
,StringValueSegment
Segment for all non primitive types.
Each element is encoded to a binary that is not compressed. The compression of the segment (if any) is realized by not repeating elements.
Finds best encoding among:
- raw - list of values stored verbatim, each preceded by its size varint32 encoded
- enum - the list of unique values are stored at the beginning of the segment.
Each value has an implicit id (the order in the list). The rest of the segment is the list of ids and can be encoded in one of the following formats
- VB: varint32 of each id
- FPROF: coded with the FPROF codec + varint32 of remaining
- RLE: run length encoded
-
Field Summary
Fields inherited from class org.yamcs.parameterarchive.BaseSegment
FORMAT_ID_BinaryValueSegment, FORMAT_ID_BooleanValueSegment, FORMAT_ID_DoubleValueSegment, FORMAT_ID_FloatValueSegment, FORMAT_ID_GapSegment, FORMAT_ID_GenericValueSegment, FORMAT_ID_IntValueSegment, FORMAT_ID_LongValueSegment, FORMAT_ID_ParameterStatusSegment, FORMAT_ID_SortedTimeValueSegmentV1, FORMAT_ID_SortedTimeValueSegmentV2, FORMAT_ID_StringValueSegment, formatId
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
add element to the end of the segmentvoid
boolean
get
(int index) int
E[]
getRangeArray
(int posStart, int posStop, boolean ascending) E[]
getRleRangeDescending
(int posStart, int posStop) void
protected void
parse
(ByteBuffer bb) int
size()
the number of elements in this segment (not taking into account any compression due to run-length encoding)void
writeRaw
(ByteBuffer bb) void
writeTo
(ByteBuffer bb) Methods inherited from class org.yamcs.parameterarchive.BaseSegment
getFormatId, parseSegment
-
Method Details
-
add
add element to the end of the segment- Parameters:
e
-
-
add
-
writeTo
- Specified by:
writeTo
in classBaseSegment
-
writeRaw
-
parse
- Throws:
DecodingException
-
getMaxSerializedSize
public int getMaxSerializedSize()- Specified by:
getMaxSerializedSize
in classBaseSegment
- Returns:
- a high approximation for the serialized size in order to allocate a ByteBuffer big enough
-
getRangeArray
-
getRleRangeDescending
-
get
-
size
public int size()the number of elements in this segment (not taking into account any compression due to run-length encoding)- Specified by:
size
in classBaseSegment
- Returns:
-
consolidate
public void consolidate()- Overrides:
consolidate
in classBaseSegment
-
makeWritable
public void makeWritable()- Overrides:
makeWritable
in classBaseSegment
-
equals
-