public abstract class Counter extends Object
Constructor and Description |
---|
Counter() |
Modifier and Type | Method and 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-2012 Apache Software Foundation. All Rights Reserved.