|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.stackmob.sdk.model.StackMobCounter
public class StackMobCounter
Represents a integer that can be incremented atomically. Its purpose is to allow you to have a value that can be incremented from multiple clients without worrying about synchronization. Use cases include a score tracker or thumbs-up button.
| Constructor Summary | |
|---|---|
StackMobCounter()
|
|
| Method Summary | |
|---|---|
void |
forceTo(int val)
Force the counter to a particular value, overriding the increment. |
int |
get()
get the current local value of the counter |
int |
getIncrement()
get the value that will be use for incrementing the counter on the next save |
int |
updateAtomicallyBy(int increment)
Increment the value by a number (positive or negative). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StackMobCounter()
| Method Detail |
|---|
public int updateAtomicallyBy(int increment)
increment - the value to change the counter by
public int get()
public int getIncrement()
public void forceTo(int val)
val - the value the counter should be set to
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||