|
|
@@ -46,6 +46,7 @@ public class LongAdder extends Striped64 implements Serializable { |
|
|
|
/** |
|
|
|
* Version of plus for use in retryUpdate |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
final long fn(long v, long x) { return v + x; } |
|
|
|
|
|
|
|
/** |
|
|
@@ -153,6 +154,7 @@ public class LongAdder extends Striped64 implements Serializable { |
|
|
|
* |
|
|
|
* @return the String representation of the {@link #sum} |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public String toString() { |
|
|
|
return Long.toString(sum()); |
|
|
|
} |
|
|
@@ -162,6 +164,7 @@ public class LongAdder extends Striped64 implements Serializable { |
|
|
|
* |
|
|
|
* @return the sum |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public long longValue() { |
|
|
|
return sum(); |
|
|
|
} |
|
|
@@ -170,6 +173,7 @@ public class LongAdder extends Striped64 implements Serializable { |
|
|
|
* Returns the {@link #sum} as an {@code int} after a narrowing |
|
|
|
* primitive conversion. |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public int intValue() { |
|
|
|
return (int)sum(); |
|
|
|
} |
|
|
@@ -178,6 +182,7 @@ public class LongAdder extends Striped64 implements Serializable { |
|
|
|
* Returns the {@link #sum} as a {@code float} |
|
|
|
* after a widening primitive conversion. |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public float floatValue() { |
|
|
|
return (float)sum(); |
|
|
|
} |
|
|
@@ -186,6 +191,7 @@ public class LongAdder extends Striped64 implements Serializable { |
|
|
|
* Returns the {@link #sum} as a {@code double} after a widening |
|
|
|
* primitive conversion. |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public double doubleValue() { |
|
|
|
return (double)sum(); |
|
|
|
} |
|
|
|