public class RangedSequencer extends Sequencer
It is multi-thread safe, and has high performance.
它是线程安全的,而且性能高。
Modifier and Type | Field and Description |
---|---|
protected long |
loopSpot |
protected long |
offset |
protected long |
range |
currentValue
Constructor and Description |
---|
RangedSequencer()
Constructs an instance with a range of [0, Long.MAX_VALUE-1] and 0 as the initial number.
创建一个实例,指定初始值和最小值都是0,最大值是Long.MAX_VALUE-1。 |
RangedSequencer(long init)
Constructs an instance with a range of [0, Long.MAX_VALUE-1] and specified initial number.
创建一个实例,指定初始值。最小值是0,最大值是Long.MAX_VALU-1。 |
RangedSequencer(long min,
long max)
Constructs an instance, with specified range,
and use the low boundary as initial number.
创建一个实例,指定最小、最大值,初始值就是最小值。 |
RangedSequencer(long min,
long max,
long init)
Constructs an instance, with specified range and initial number.
创建一个实例,指定最小、最大、初始值。 |
protected long offset
protected long range
protected long loopSpot
public RangedSequencer(long min, long max, long init)
min
- 最小值max
- 最大值init
- 初始值public RangedSequencer(long min, long max)
min
- 最小值max
- 最大值public RangedSequencer(long init)
init
- 初始值public RangedSequencer()
Copyright © 2014. All Rights Reserved.