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
()
| 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 |
no outgoing calls
no test coverage detected