public final class SimpleCounter extends java.lang.Object implements Counter
This class is not thread safe, see ThreadSafeCounter for a thread safe counter!
Counter.CreatorSIMPLE, THREAD_SAFE| Constructor and Description |
|---|
SimpleCounter()
Default constructor.
|
SimpleCounter(Counter count)
Copy constructor.
|
SimpleCounter(int val)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
add(Counter counter)
Add something to the counter.
|
int |
add(int add)
Add something to the counter.
|
int |
add1()
Add 1 to counter.
|
int |
getValue()
Get the value.
|
void |
setValue(int value)
Set the value.
|
int |
subtract(Counter counter)
Subtract something from the counter.
|
int |
subtract(int sub)
Subtract something from the counter.
|
int |
subtract1()
Subtract 1 from counter.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitadd, simple, simple, substract, substract, substract1, subtract, threadSafe, threadSafepublic SimpleCounter()
public SimpleCounter(int val)
val.val - init valuepublic int add(int add)
public int add1()
public int subtract(int sub)
public int subtract1()
public int getValue()
public void setValue(int value)
public java.lang.String toString()
toString in class java.lang.Object