public abstract class AbstractGenerator<T> extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
protected int |
fetchSize
每次抓取的个数
|
protected int |
genNum
生成器本批次生成的数量
|
protected AtomicBoolean |
hadUsedBeginVal |
protected int |
increment
值每次增加的跨度
|
protected T |
initialVal
初始化值
|
protected YesNo |
isCycle
此生成器值是否到达最大值后循环生成
|
protected T |
maxVal
最大值,该属性可为null
|
| 限定符 | 构造器和说明 |
|---|---|
protected |
AbstractGenerator(int increment,
int fetchSize,
String initialVal,
String currentVal,
String maxVal,
YesNo isCycle) |
| 限定符和类型 | 方法和说明 |
|---|---|
abstract T |
currentVal()
获取当前值
|
int |
getFetchSize() |
int |
getGenNum() |
int |
getIncrement() |
T |
getInitialVal() |
YesNo |
getIsCycle() |
T |
getMaxVal() |
abstract T |
nextStepVal(String curVal)
批量加载数据,返回下一次加载时的起始值
并且设置当前值段为 新传入的curVal~ 新nextStepVal
设置genNum=0
|
abstract T |
nextVal()
获取生成器的下一个值
|
protected AtomicBoolean hadUsedBeginVal
protected volatile int genNum
protected int increment
protected int fetchSize
protected T initialVal
protected T maxVal
protected YesNo isCycle
public abstract T nextVal()
public abstract T currentVal()
public abstract T nextStepVal(String curVal)
public int getIncrement()
public int getFetchSize()
public T getInitialVal()
public T getMaxVal()
public YesNo getIsCycle()
public int getGenNum()
Copyright © 2016. All rights reserved.