public class SoftIncrementCount extends Object
| 构造器和说明 |
|---|
SoftIncrementCount(long max)
实例化一个自增信息的对象,包括最大值
Instantiate an object with incremental information, including the maximum value and initial value, IncreaseTick
|
SoftIncrementCount(long max,
long start)
实例化一个自增信息的对象,包括最大值
Instantiate an object with incremental information, including the maximum value and initial value, IncreaseTick
|
SoftIncrementCount(long max,
long start,
int tick)
实例化一个自增信息的对象,包括最大值
Instantiate an object with incremental information, including the maximum value and initial value, IncreaseTick
|
| 限定符和类型 | 方法和说明 |
|---|---|
long |
GetCurrentValue()
获取自增信息,获得数据之后,下一次获取将会自增,如果自增后大于最大值,则会重置为最小值,如果小于最小值,则会重置为最大值。
|
int |
getIncreaseTick()
获取增加的单元,如果为0,就是不增加。
|
long |
getMaxValue()
获取当前的计数器的最大的设置值。
|
void |
ResetCurrentValue()
将当前的值重置为初始值。
|
void |
ResetCurrentValue(long value)
将当前的值重置为指定值,该值不能大于max,如果大于max值,就会自动设置为max
Reset the current value to the specified value.
|
void |
ResetMaxValue(long max)
重置当前序号的最大值,最大值应该大于初始值,如果当前值大于最大值,则当前值被重置为最大值
Reset the maximum value of the current serial number.
|
void |
ResetStartValue(long start)
重置当前序号的初始值,需要小于最大值,如果当前值小于初始值,则当前值被重置为初始值。
|
void |
setIncreaseTick(int increaseTick)
设置增加的单元,如果设置为0,就是不增加。
|
String |
toString() |
public SoftIncrementCount(long max)
max - 数据的最大值,必须指定public SoftIncrementCount(long max,
long start)
max - 数据的最大值,必须指定start - 数据的起始值,默认为0public SoftIncrementCount(long max,
long start,
int tick)
max - 数据的最大值,必须指定start - 数据的起始值,默认为0tick - 每次的增量数据public int getIncreaseTick()
public void setIncreaseTick(int increaseTick)
increaseTick - 数据值信息public long getMaxValue()
public long GetCurrentValue()
public void ResetMaxValue(long max)
max - 最大值public void ResetStartValue(long start)
start - 初始值public void ResetCurrentValue()
public void ResetCurrentValue(long value)
value - 指定的数据值Copyright © 2022. All rights reserved.