Class LongRingBuffer
public final class LongRingBuffer
extends RingBuffer<Long>
implements it.unimi.dsi.fastutil.longs.LongIterable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(long value) void
Deprecated.double
avg()
Optimized non-overflowing average calculation.@NonNull it.unimi.dsi.fastutil.longs.LongIterator
int
countSince
(long threshold) Gets the count of consecutive elements that are higher thanthresholdValue
.long
get
(int i) long[]
long
getLast()
it.unimi.dsi.fastutil.ints.IntIterator
intervalCountIterator
(long from, long to, long interval) @NonNull it.unimi.dsi.fastutil.longs.LongIterator
iterator()
long
max
(long initialValue) long
min
(long initialValue) int
size()
Methods inherited from class dev.pfaff.altargui.glfw.ring.RingBuffer
currentIndex, firstRun, inc, presentSize, ringToStraightIndex, ringToStraightIndexNoFirstRun, straightToRingIndex, straightToRingIndexNoFirstRun
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface it.unimi.dsi.fastutil.longs.LongIterable
forEach, forEach, forEach, longIterator, longSpliterator, spliterator
-
Constructor Details
-
LongRingBuffer
public LongRingBuffer(int length)
-
-
Method Details
-
getContentsInternal
public long[] getContentsInternal() -
size
public int size()- Specified by:
size
in classRingBuffer<Long>
-
get
public long get(int i) -
getLast
public long getLast() -
add
-
add
public void add(long value) -
avg
public double avg()Optimized non-overflowing average calculation. -
iterator
-
backIterator
public @NonNull it.unimi.dsi.fastutil.longs.LongIterator backIterator() -
intervalCountIterator
public it.unimi.dsi.fastutil.ints.IntIterator intervalCountIterator(long from, long to, long interval) -
countSince
public int countSince(long threshold) Gets the count of consecutive elements that are higher thanthresholdValue
. If the elements are not monotonically increasing, the results are unspecified. -
max
public long max(long initialValue) -
min
public long min(long initialValue)
-