public class SGVetter
extends java.lang.Object
Machine to validate the operation of the sequence generator. This is a re-implementation of the sequence generator in a less efficient style whose correctness is easier to reason about.
Modifier and Type | Field and Description |
---|---|
private long |
_ALLOCATION_COUNT |
private boolean |
_CAN_CYCLE |
private java.math.BigInteger |
_currentValue |
private boolean |
_INCREASING |
private java.math.BigInteger |
_MAX |
private java.math.BigInteger |
_MIN |
private java.math.BigInteger |
_RESTART |
private java.math.BigInteger |
_STEP |
private java.math.BigInteger |
_upperBound |
private long |
_valuesRemaining |
private static long |
MINIMUM_CACHED_VALUE_COUNT |
Constructor and Description |
---|
SGVetter(java.lang.Long currentValue,
boolean canCycle,
long step,
long max,
long min,
long restart,
long allocationCount) |
Modifier and Type | Method and Description |
---|---|
private void |
advance() |
private java.math.BigInteger |
bump(java.math.BigInteger original) |
private java.math.BigInteger |
cloneBigInteger(java.math.BigInteger original) |
java.lang.Long |
getNextValue()
Get the next value in the sequence.
|
java.lang.Long |
getUpperBound()
Get the upper bound
|
private boolean |
overflowed(java.math.BigInteger newValue) |
private static final long MINIMUM_CACHED_VALUE_COUNT
private boolean _CAN_CYCLE
private java.math.BigInteger _STEP
private java.math.BigInteger _MAX
private java.math.BigInteger _MIN
private java.math.BigInteger _RESTART
private long _ALLOCATION_COUNT
private boolean _INCREASING
private java.math.BigInteger _currentValue
private long _valuesRemaining
private java.math.BigInteger _upperBound
public SGVetter(java.lang.Long currentValue, boolean canCycle, long step, long max, long min, long restart, long allocationCount) throws java.lang.Exception
java.lang.Exception
public java.lang.Long getNextValue()
Get the next value in the sequence. Returns null if the sequence is exhausted.
public java.lang.Long getUpperBound()
private void advance()
private java.math.BigInteger bump(java.math.BigInteger original)
private boolean overflowed(java.math.BigInteger newValue)
private java.math.BigInteger cloneBigInteger(java.math.BigInteger original)
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.