Package kieker.analysis.util.timeseries
Class TimeSeries<T extends ITimeSeriesPoint>
java.lang.Object
kieker.analysis.util.timeseries.TimeSeries<T>
- Type Parameters:
T
- Type of the elements in this time series.
- All Implemented Interfaces:
java.lang.Iterable<T>
,IBackwardsIterable<T>
- Direct Known Subclasses:
BoundedTimeSeries
public class TimeSeries<T extends ITimeSeriesPoint> extends java.lang.Object implements java.lang.Iterable<T>, IBackwardsIterable<T>
- Since:
- 1.14
- Author:
- Sören Henning
-
Constructor Summary
Constructors Constructor Description TimeSeries()
Constructs an empty time series.TimeSeries(TimeSeries<T> timeSeries)
Constructs a copy of the specified time series. -
Method Summary
Modifier and Type Method Description void
appendBegin(T timeSeriesPoint)
Appends a point at the end of this time series, so the point is the new earliest point in this time series.void
appendEnd(T timeSeriesPoint)
Appends a point at the end of this time series, so the point is the new latest point in this time series.java.util.Iterator<T>
backwardsIterator()
Returns an iterator over the time series points in this time series.ITimeSeriesPoint
getBegin()
Returns the first/earliest point of this time series, or if this time series is empty.ITimeSeriesPoint
getEnd()
Returns the last/latest point of this time series, or if this time series is empty.boolean
isEmpty()
Returnstrue
if this time series contains no time series points.java.util.Iterator<T>
iterator()
Returns an iterator over the time series points in this time series.ITimeSeriesPoint
removeBegin()
Retrieves and removes the first/earliest point of this time series, or returns if this time series is empty.ITimeSeriesPoint
removeEnd()
Retrieves and removes the last/latest point of this time series, or returns if this time series is empty.int
size()
Returns the number of time series points in this time series.java.util.stream.Stream<T>
stream()
Returns a sequentialStream
with this time series as its source.java.lang.String
toString()
-
Constructor Details
-
TimeSeries
public TimeSeries()Constructs an empty time series. -
TimeSeries
Constructs a copy of the specified time series.
-
-
Method Details
-
appendBegin
Appends a point at the end of this time series, so the point is the new earliest point in this time series. -
appendEnd
Appends a point at the end of this time series, so the point is the new latest point in this time series. -
getBegin
Returns the first/earliest point of this time series, or if this time series is empty. -
getEnd
Returns the last/latest point of this time series, or if this time series is empty. -
removeBegin
Retrieves and removes the first/earliest point of this time series, or returns if this time series is empty. -
removeEnd
Retrieves and removes the last/latest point of this time series, or returns if this time series is empty. -
iterator
Returns an iterator over the time series points in this time series. The points will be returned in temporal order from earliest to latest.- Specified by:
iterator
in interfacejava.lang.Iterable<T extends ITimeSeriesPoint>
-
backwardsIterator
Returns an iterator over the time series points in this time series. The points will be returned in temporal order from latest to earliest.- Specified by:
backwardsIterator
in interfaceIBackwardsIterable<T extends ITimeSeriesPoint>
- Returns:
- returns the iterator
-
stream
Returns a sequentialStream
with this time series as its source. -
size
public int size()Returns the number of time series points in this time series. -
isEmpty
public boolean isEmpty()Returnstrue
if this time series contains no time series points. -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-