T - the type of the stored valuespublic class TimestampedList<T> extends LinkedList<TimestampedEntry<T>>
modCount| Constructor and Description |
|---|
TimestampedList(int capacity)
Constructor that allows to set the max amount of
items in the list.
|
TimestampedList(T initialValue,
int capacity)
Constructor that allows to set the max amount of
items in the list and the initial value.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAllSorted(Collection<TimestampedEntry<T>> other)
Adds elements of another TimestampedList
to the bottom of this list.
|
void |
addValue(T value)
Adds a new value and the current timestamp to the list.
|
long |
getLatestTimestamp()
Returns the timestamp of the latest value of the list.
|
T |
getLatestValue()
Returns the latest value of the list.
|
String |
toString() |
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArrayiteratorequals, hashCode, listIterator, removeRange, subListcontainsAll, isEmpty, removeAll, retainAllfinalize, getClass, notify, notifyAll, wait, wait, waitcontainsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subListparallelStream, removeIf, streampublic TimestampedList(int capacity)
capacity - the max amount of items in the listpublic TimestampedList(T initialValue, int capacity)
initialValue - the first item on the listcapacity - the max amount of items in the listpublic void addValue(T value)
value - the new valuepublic void addAllSorted(Collection<TimestampedEntry<T>> other)
other - the TimestampedList that is appendedpublic T getLatestValue()
public long getLatestTimestamp()
public String toString()
toString in class AbstractCollection<TimestampedEntry<T>>Copyright © 2017–2019. All rights reserved.