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 voidappendBegin(T timeSeriesPoint)Appends a point at the end of this time series, so the point is the new earliest point in this time series.voidappendEnd(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.ITimeSeriesPointgetBegin()Returns the first/earliest point of this time series, or if this time series is empty.ITimeSeriesPointgetEnd()Returns the last/latest point of this time series, or if this time series is empty.booleanisEmpty()Returnstrueif 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.ITimeSeriesPointremoveBegin()Retrieves and removes the first/earliest point of this time series, or returns if this time series is empty.ITimeSeriesPointremoveEnd()Retrieves and removes the last/latest point of this time series, or returns if this time series is empty.intsize()Returns the number of time series points in this time series.java.util.stream.Stream<T>stream()Returns a sequentialStreamwith this time series as its source.java.lang.StringtoString()
-
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:
iteratorin 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:
backwardsIteratorin interfaceIBackwardsIterable<T extends ITimeSeriesPoint>- Returns:
- returns the iterator
-
stream
Returns a sequentialStreamwith 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()Returnstrueif this time series contains no time series points. -
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-