public class SortedTimeSegment extends BaseSegment implements ValueSegment
| Modifier and Type | Field and Description |
|---|---|
static int |
NUMBITS_MASK |
static long |
SEGMENT_MASK |
static int |
TIMESTAMP_MASK |
static int |
VERSION |
FORMAT_ID_BinaryValueSegment, FORMAT_ID_BooleanValueSegment, FORMAT_ID_DoubleValueSegment, FORMAT_ID_FloatValueSegment, FORMAT_ID_GenericValueSegment, FORMAT_ID_IntValueSegment, FORMAT_ID_LongValueSegment, FORMAT_ID_OldBooleanValueSegment, FORMAT_ID_ParameterStatusSegment, FORMAT_ID_SortedTimeValueSegment, FORMAT_ID_StringValueSegment, formatId| Constructor and Description |
|---|
SortedTimeSegment(long segmentStart) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int pos,
Value engValue) |
int |
add(long instant)
Insert instant into the array and return the position at which it has been inserted.
|
BaseSegment |
consolidate() |
PrimitiveIterator.OfLong |
getAscendingIterator(long startFrom)
Constructs an ascending iterator starting from a specified value (inclusive)
|
PrimitiveIterator.OfLong |
getDescendingIterator(long startFrom)
Constructs an descending iterator starting from a specified value (exclusive)
|
int |
getMaxSerializedSize() |
static long |
getNextSegmentStart(long instant) |
long[] |
getRange(int posStart,
int posStop,
boolean ascending)
returns an array containing the values in the range [posStart, posStop) if ascending or [posStop, posStart) if descending
|
static long |
getSegmentDuration()
duration in milliseconds of one segment
|
long |
getSegmentEnd() |
static long |
getSegmentEnd(long instant)
returns the end of the segment where the instant fits
|
static long |
getSegmentId(long instant)
returns the ID of the segment where the instant fits - this is the same with segment start
|
long |
getSegmentStart() |
static long |
getSegmentStart(long instant)
returns the start of the segment where instant fits
|
long |
getT0() |
long |
getTime(int idx)
get timestamp at position idx
|
Value |
getValue(int index)
returns Value at position index
|
static boolean |
overlap(long segmentId,
long start,
long stop)
returns true if the segment overlaps the [start,stop) interval
|
static SortedTimeSegment |
parseFrom(ByteBuffer bb,
long segmentStart) |
int |
search(long instant)
performs a binary search in the time segment and returns the position of t or where t would fit in.
|
int |
size() |
String |
toString() |
void |
writeTo(ByteBuffer bb)
Encode the time array
|
getFormatId, parseSegmentpublic static final int NUMBITS_MASK
public static final int TIMESTAMP_MASK
public static final long SEGMENT_MASK
public static final int VERSION
public int add(long instant)
instant - public long getTime(int idx)
idx - public PrimitiveIterator.OfLong getAscendingIterator(long startFrom)
startFrom - public PrimitiveIterator.OfLong getDescendingIterator(long startFrom)
startFrom - public long getT0()
public static long getSegmentStart(long instant)
instant - public static long getSegmentId(long instant)
instant - public static long getSegmentEnd(long instant)
instant - public static long getNextSegmentStart(long instant)
public static boolean overlap(long segmentId,
long start,
long stop)
segmentId - start - stop - public int search(long instant)
instant - Arrays.binarySearch(int[], int)public int size()
size in interface ValueSegmentsize in class BaseSegmentpublic long getSegmentStart()
public void writeTo(ByteBuffer bb)
writeTo in class BaseSegmentpublic static SortedTimeSegment parseFrom(ByteBuffer bb, long segmentStart) throws DecodingException
DecodingExceptionpublic int getMaxSerializedSize()
getMaxSerializedSize in class BaseSegmentpublic Value getValue(int index)
ValueSegmentgetValue in interface ValueSegmentpublic long getSegmentEnd()
public long[] getRange(int posStart,
int posStop,
boolean ascending)
BaseSegmentgetRange in class BaseSegmentpublic void add(int pos,
Value engValue)
add in interface ValueSegmentpublic BaseSegment consolidate()
consolidate in interface ValueSegmentpublic static long getSegmentDuration()
Copyright © 2018 Space Applications Services. All rights reserved.