/** * @return the start of the time series */ public long getStart() { if (timestamps.isEmpty()) { return 0; } else { return timestamps.get(0); } }
/** * @return the end of the time series */ public long getEnd() { if (timestamps.isEmpty()) { return 0; } else { return timestamps.get(timestamps.size() - 1); } }
/** * @param list the list * @param start the start index * @param end the end index * @return sublist */ public static LongList sublist(LongList list, int start, int end) { if (list.isEmpty()) { return list; } if (start < 0 || end > list.size()) { throw new IndexOutOfBoundsException(""); } return new LongList(copyOfRange(list.toArray(), start, end), end - start); }
/** * A stream over the points * * @return the points as points */ public Stream<Point> points() { if (timestamps.isEmpty()) { return Stream.empty(); } return Stream.iterate(of(0), pair -> of(pair.getIndex() + 1)).limit(timestamps.size()); }
/** * A stream over the strace-points * * @return the points as strace-points */ public Stream<StracePoint> points() { if (timestamps.isEmpty()) { return Stream.empty(); } return Stream.iterate(of(0), pair -> of(pair.getIndex() + 1)).limit(timestamps.size()); }
/** * Sets the start and end end based on the */ private void setStartAndEnd() { //When the time stamps are empty we do not set the start and end //An aggregation or analysis response does not have a data field per default. if (!timestamps.isEmpty()) { start = timestamps.get(0); end = timestamps.get(size() - 1); } }
/** * A stream over the points * * @return the points as points */ public Stream<Point> points() { if (timestamps.isEmpty()) { return Stream.empty(); } return Stream.iterate(of(0), pair -> of(pair.getIndex() + 1)).limit(timestamps.size()); }
/** * Sets the start and end end based on the */ private void setStartAndEnd() { //When the time stamps are empty we do not set the start and end //An aggregation or analysis response does not have a data field per default. if (!timestamps.isEmpty()) { sort(); start = timestamps.get(0); end = timestamps.get(size() - 1); } }