An implementation of LongCounter that is just an AtomicLong.
| 22 | * An implementation of {@link LongCounter} that is just an {@link AtomicLong}. |
| 23 | */ |
| 24 | final class AtomicLongCounter implements LongCounter { |
| 25 | private final AtomicLong counter = new AtomicLong(); |
| 26 | |
| 27 | /** |
| 28 | * Creates an {@link AtomicLongCounter}. |
| 29 | */ |
| 30 | AtomicLongCounter() { |
| 31 | } |
| 32 | |
| 33 | @Override |
| 34 | public void add(long delta) { |
| 35 | counter.getAndAdd(delta); |
| 36 | } |
| 37 | |
| 38 | @Override |
| 39 | public long value() { |
| 40 | return counter.get(); |
| 41 | } |
| 42 | } |
nothing calls this directly
no outgoing calls
no test coverage detected