|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jabb.util.stat.AtomicMinLong
public class AtomicMinLong
It stores the minimum value;
the compare-and-change procedure is synchronized so that multi-thread safe is ensured.
存放最小值,“比较然后交换”的过程是同步的,所以它是多线程安全的。
| Field Summary | |
|---|---|
protected Object |
updateLock
|
protected long |
value
|
| Constructor Summary | |
|---|---|
AtomicMinLong()
Constructs an instance to store the minimum value. 创建一个实例,用来保存最小值。 |
|
| Method Summary | |
|---|---|
long |
get()
getCurrent value. 获得当前值。 |
long |
getAndMin(long newValue)
Compare a value with current minimal value and make the less one the new minimum value; Old minimum value before comparison is returned. 拿一个值同当前值比较,把其中小的那个设置为新的最小值,返回比较之前的旧的最小值。 |
int |
intValue()
getCurrent value as int. 以int类型获得当前值。 |
long |
longValue()
getCurrent value. 获得当前值。 |
void |
min(long newValue)
Compare a value with current minimum value and make the less one the new minimum value. 拿一个值同当前值比较,把其中小的那个设置为新的最小值。 |
long |
minAndGet(long newValue)
Compare a value with current minimal value and make the less one the new minimum value; New minimum value after comparison is returned. 拿一个值同当前值比较,把其中小的那个设置为新的最小值,返回比较之后的新的最小值。 |
void |
reset()
Reset to initial status. 回复到初始状态。 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected long value
protected Object updateLock
| Constructor Detail |
|---|
public AtomicMinLong()
| Method Detail |
|---|
public long minAndGet(long newValue)
newValue - 拿来作比较的值。
public long getAndMin(long newValue)
newValue - 拿来作比较的值。
public void min(long newValue)
newValue - 拿来作比较的值。public void reset()
public long get()
public long longValue()
public int intValue()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||