MCPcopy Index your code
hub / github.com/VolmitSoftware/Adapt / put

Method put

src/main/java/com/volmit/adapt/util/Average.java:56–71  ·  view source on GitHub ↗

Put a value into the average (rolls over if full) @param i the value

(double i)

Source from the content-addressed store, hash-verified

54 * @param i the value
55 */
56 public void put(double i) {
57
58 dirty = true;
59
60 if (brandNew) {
61 DoubleArrayUtils.fill(values, i);
62 lastSum = size() * i;
63 brandNew = false;
64 return;
65 }
66
67 double current = values[cursor];
68 lastSum = (lastSum - current) + i;
69 values[cursor] = i;
70 cursor = cursor + 1 < size() ? cursor + 1 : 0;
71 }
72
73 /**
74 * Get the current average

Callers 15

PapiExpansionMethod · 0.45
notifyXPMethod · 0.45
registerSkillMethod · 0.45
addStatMethod · 0.45
getSkillLineMethod · 0.45
joinMethod · 0.45
setAdaptationMethod · 0.45
activateMethod · 0.45
onTickMethod · 0.45
MaterialValueClass · 0.45
getValueMethod · 0.45

Calls 2

fillMethod · 0.95
sizeMethod · 0.95

Tested by

no test coverage detected