public final class StopwatchTimeline extends Timeline<StopwatchTimeRange>
Stopwatch
state on a rolling period of time.timeRanges, timeRangeWidth
Constructor and Description |
---|
StopwatchTimeline(int capacity,
long timeRangeWidth)
Main constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addSplit(Split split)
Main method used to insert the split on the timeline:
Split start is used to determine in which time-range it should be split.
|
protected StopwatchTimeRange |
createTimeRange(long startTimestamp,
long endTimestamp)
Produces a
StopwatchTimeRange object. |
TimelineSample<StopwatchTimeRange> |
sample()
Take a snapshot of the timeline.
|
getOrCreateTimeRange
public StopwatchTimeline(int capacity, long timeRangeWidth)
capacity
- Number of time range.timeRangeWidth
- Width of each time rangeprotected StopwatchTimeRange createTimeRange(long startTimestamp, long endTimestamp)
StopwatchTimeRange
object.createTimeRange
in class Timeline<StopwatchTimeRange>
startTimestamp
- Range beginningendTimestamp
- Range endingStopwatchTimeRange
objectpublic void addSplit(Split split)
split
- Splitpublic TimelineSample<StopwatchTimeRange> sample()
sample
in class Timeline<StopwatchTimeRange>
Copyright © 2019. All rights reserved.