|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Counter
A Counter keeps track of a long value. It depends on the counter if increments are thread-safe. The get is thread-safe in the sense that it will see a recently published value. It doesn't need to mean that it will see the most recently published value.
| Method Summary | |
|---|---|
long |
get()
Gets the current value. |
void |
inc()
Increments the counter by one. |
void |
inc(int amount)
Increments the counter by the given amount. |
| Method Detail |
|---|
long get()
void inc()
void inc(int amount)
amount - the amount to increase the counter with.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||