public class LongCounter extends Object implements Serializable, Cloneable
Constructor and Description |
---|
LongCounter()
Construct a LongCounter.
|
LongCounter(long count)
Construct a LongCounter with a starting value.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Return a cloned copy of this object.
|
long |
decrement()
Decrement the counter.
|
boolean |
equals(Object obj)
Check if the given object is equal to this.
|
long |
getCount()
Return the current value of the counter.
|
long |
increment()
Increment the counter.
|
static LongCounter |
makeDirectional(LongCounter counter,
boolean increasing)
Returns a directional counter.
|
static LongCounter |
makeSynchronized(LongCounter counter)
Return a synchronized counter.
|
void |
reset()
Reset the counter to zero.
|
String |
toString()
Return a string representation of this.
|
public LongCounter(long count)
count
- Starting value for counter.public LongCounter()
public long increment()
public long decrement()
public long getCount()
public void reset()
public boolean equals(Object obj)
public String toString()
public Object clone()
public static LongCounter makeSynchronized(LongCounter counter)
counter
- LongCounter to synchronize.public static LongCounter makeDirectional(LongCounter counter, boolean increasing)
counter
- LongCounter to make directional.increasing
- True to create an increasing only
or false to create a decreasing only.Copyright © 2018 JBoss by Red Hat. All rights reserved.