|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opengts.util.AccumulatorInteger
public class AccumulatorInteger
Accumulator Integer container. Typically used in conditions where it is desireable to pass an accumulator to an inner-class and have the value accessible from outside the inner-class. (If the accumulator is to be used from different threads in a multi-threaded environment, use "AtomicInteger" instead).
Constructor Summary | |
---|---|
AccumulatorInteger()
Constructor |
|
AccumulatorInteger(int val)
Constructor |
Method Summary | |
---|---|
void |
add(int v)
Adds the specified value to the accumulator |
void |
decrement(int v)
Decrement the value of the accumulator by 1 |
int |
get()
Gets the value of the accumulator |
void |
increment()
Increment the value of the accumulator by 1 |
int |
next()
Increment, and return the next value |
int |
next(int v)
Add the specified value, and return the result |
void |
set(int v)
Sets the value of the accumulator |
void |
subtract(int v)
Subtracts the specified value from the accumulator |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AccumulatorInteger()
public AccumulatorInteger(int val)
val
- Initial valueMethod Detail |
---|
public void set(int v)
v
- The new valuepublic int get()
public void add(int v)
v
- The value to addpublic void subtract(int v)
v
- The value to subtractpublic void increment()
public void decrement(int v)
public int next()
public int next(int v)
v
- The value to add
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |