public abstract class Counter extends Object
Constructor | Description |
---|---|
Counter() |
Modifier and Type | Method | Description |
---|---|---|
abstract long |
addAndGet(long delta) |
Adds the given delta to the counters current value
|
abstract long |
get() |
Returns the counters current value
|
static Counter |
newCounter() |
Returns a new counter.
|
static Counter |
newCounter(boolean threadSafe) |
Returns a new counter.
|
public abstract long addAndGet(long delta)
delta
- the delta to addpublic abstract long get()
public static Counter newCounter()
public static Counter newCounter(boolean threadSafe)
threadSafe
- true
if the returned counter can be used by multiple
threads concurrently.Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.