MCPcopy Create free account
hub / github.com/antlr/codebuff / sum

Method sum

output/java_guava/1.4.17/LongAdder.java:118–130  ·  view source on GitHub ↗

Returns the current sum. The returned value is NOT an atomic snapshot; invocation in the absence of concurrent updates returns an accurate result, but concurrent updates that occur while the sum is being calculated might not be incorporated. @return the sum

()

Source from the content-addressed store, hash-verified

116
117
118 public long sum() {
119 long sum = base;
120 Cell[] as = cells;
121 if (as != null) {
122 int n = as.length;
123 for (int i = 0; i < n; ++i) {
124 Cell a = as[i];
125 if (a != null)
126 sum += a.value;
127 }
128 }
129 return sum;
130 }
131
132 /**
133 * Resets variables maintaining the sum to zero. This method may

Callers 6

toStringMethod · 0.95
longValueMethod · 0.95
intValueMethod · 0.95
floatValueMethod · 0.95
doubleValueMethod · 0.95
writeObjectMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected