public class CounterImpl extends Object implements Counter, Serializable
Constructor and Description |
---|
CounterImpl()
Default Constructor
|
CounterImpl(long initialValue)
Constructor with initial value
|
Modifier and Type | Method and Description |
---|---|
long |
decrement()
Decrement the counter by 1
|
long |
decrement(long amount)
Decrement the counter by given amount
|
long |
getAndSet(long newValue)
Returns the value of the counter and sets it to the new value
|
long |
getValue()
Gets current value of the counter
|
long |
increment()
Increment the counter by 1
|
long |
increment(long amount)
Increment the counter by given amount
|
void |
setValue(long newValue)
Sets the value of the counter to the supplied value
|
public CounterImpl()
public CounterImpl(long initialValue)
initialValue
- public long increment()
public long decrement()
public long getAndSet(long newValue)
public long getValue()
public long increment(long amount)
public long decrement(long amount)
Copyright 2001-2019, Terracotta, Inc.