Lines Matching refs:sum
42 * {@code long} sum. When updates (method {@link #add}) are contended
44 * contention. Method {@link #sum} (or, equivalently, {@link
46 * variables maintaining the sum.
49 * multiple threads update a common sum that is used for purposes such
75 * Creates a new adder with initial sum of zero.
111 * Returns the current sum. The returned value is <em>NOT</em> an
114 * occur while the sum is being calculated might not be
117 * @return the sum
119 public long sum() {
121 long sum = base;
125 sum += a.value;
127 return sum;
131 * Resets variables maintaining the sum to zero. This method may
148 * Equivalent in effect to {@link #sum} followed by {@link
155 * @return the sum
159 long sum = base;
164 sum += a.value;
169 return sum;
173 * Returns the String representation of the {@link #sum}.
174 * @return the String representation of the {@link #sum}
177 return Long.toString(sum());
181 * Equivalent to {@link #sum}.
183 * @return the sum
186 return sum();
190 * Returns the {@link #sum} as an {@code int} after a narrowing
194 return (int)sum();
198 * Returns the {@link #sum} as a {@code float}
202 return (float)sum();
206 * Returns the {@link #sum} as a {@code double} after a widening
210 return (double)sum();
222 * The current value returned by sum().
228 value = a.sum();