public class LinkedListWithSum<E>
extends java.util.AbstractSequentialList<E>
implements java.util.List<E>
constructor
. Current sum can be obtained via getSum()
.
This class is not thread-safe.
Modifier and Type | Class and Description |
---|---|
class |
LinkedListWithSum.ListIterator |
Constructor and Description |
---|
LinkedListWithSum(java.util.function.ToIntFunction<? super E> evaluator) |
Modifier and Type | Method and Description |
---|---|
long |
getSum() |
LinkedListWithSum.ListIterator |
listIterator(int index) |
int |
size() |
add, addAll, get, iterator, remove, set
add, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, of, of, of, of, of, of, of, of, of, of, of, of, remove, remove, removeAll, replaceAll, retainAll, set, sort, spliterator, subList, toArray, toArray
public LinkedListWithSum(java.util.function.ToIntFunction<? super E> evaluator)
public long getSum()
public int size()
public LinkedListWithSum.ListIterator listIterator(int index)