public abstract class Timeline<TR extends TimeRange> extends Object
Modifier and Type | Field and Description |
---|---|
protected CircularList<TR> |
timeRanges
List of time ranges.
|
protected long |
timeRangeWidth
Time range width in milliseconds.
|
Modifier | Constructor and Description |
---|---|
protected |
Timeline(int capacity,
long timeRangeWidth)
Main constructor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract TR |
createTimeRange(long startTimestamp,
long endTimestamp)
Creates time range (factory method).
|
protected TR |
getOrCreateTimeRange(long timestamp)
Returns existing time range if it already exists or create a new one.
|
abstract TimelineSample<TR> |
sample() |
protected final CircularList<TR extends TimeRange> timeRanges
protected final long timeRangeWidth
protected Timeline(int capacity, long timeRangeWidth)
capacity
- Number of time rangestimeRangeWidth
- Width of each time rangeprotected abstract TR createTimeRange(long startTimestamp, long endTimestamp)
startTimestamp
- Time range startendTimestamp
- Time range endprotected final TR getOrCreateTimeRange(long timestamp)
public abstract TimelineSample<TR> sample()
Copyright © 2019. All rights reserved.