|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opengts.util.AccumulatorLong
public class AccumulatorLong
Accumulator Long 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 "AtomicLong" instead).
Constructor Summary | |
---|---|
AccumulatorLong()
Constructor |
|
AccumulatorLong(long val)
Constructor |
Method Summary | |
---|---|
void |
add(long v)
Adds the specified value to the accumulator |
void |
decrement(long v)
Decrement the value of the accumulator by 1 |
long |
get()
Gets the value of the accumulator |
void |
increment()
Increment the value of the accumulator by 1 |
long |
next()
Increment, and return the next value |
long |
next(long v)
Add the specified value, and return the result |
void |
set(long v)
Sets the value of the accumulator |
void |
subtract(long 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 AccumulatorLong()
public AccumulatorLong(long val)
val
- Initial valueMethod Detail |
---|
public void set(long v)
v
- The new valuepublic long get()
public void add(long v)
v
- The value to addpublic void subtract(long v)
v
- The value to subtractpublic void increment()
public void decrement(long v)
public long next()
public long next(long v)
v
- The value to add
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |