Class UniqueShortGenerator
java.lang.Object
io.deephaven.engine.testutil.generator.UniqueShortGenerator
- All Implemented Interfaces:
TestDataGenerator<Short,,Short> UniqueTestDataGenerator<Short,Short>
Generates unique random shortacter values.
-
Constructor Summary
ConstructorsConstructorDescriptionUniqueShortGenerator(short from, short to) UniqueShortGenerator(short from, short to, double nullFraction) -
Method Summary
Modifier and TypeMethodDescriptiongetRandomValue(Random random) Get one random value from the generated set of values.getType()booleanAre there any values that have been generated?voidonRemove(ReadOnlyIndex toRemove) Called after a key has been removed from the map.populateChunk(ReadOnlyIndex toAdd, Random random) Create a chunk for the given index using random for any desired entropy.voidshift(long start, long end, long delta) Called when a range is shifted.
-
Constructor Details
-
UniqueShortGenerator
public UniqueShortGenerator(short from, short to) -
UniqueShortGenerator
public UniqueShortGenerator(short from, short to, double nullFraction)
-
-
Method Details
-
populateChunk
Description copied from interface:TestDataGeneratorCreate a chunk for the given index using random for any desired entropy.- Specified by:
populateChunkin interfaceTestDataGenerator<Short,Short> - Parameters:
toAdd- the index to add values forrandom- the random number generator used for this test- Returns:
- a chunk of primitives or boxed objects of type U
-
onRemove
Description copied from interface:TestDataGeneratorCalled after a key has been removed from the map.- Specified by:
onRemovein interfaceTestDataGenerator<Short,Short> - Parameters:
toRemove- the index that was removed
-
shift
public void shift(long start, long end, long delta) Description copied from interface:TestDataGeneratorCalled when a range is shifted.- Specified by:
shiftin interfaceTestDataGenerator<Short,Short> - Parameters:
start- the start of the range to shiftend- the end of the range to shiftdelta- the delta for the shift
-
hasValues
public boolean hasValues()Description copied from interface:UniqueTestDataGeneratorAre there any values that have been generated?- Specified by:
hasValuesin interfaceUniqueTestDataGenerator<Short,Short> - Returns:
- if there are any internally stored values?
-
getRandomValue
Description copied from interface:UniqueTestDataGeneratorGet one random value from the generated set of values. hasValues must be true before calling this function.- Specified by:
getRandomValuein interfaceUniqueTestDataGenerator<Short,Short> - Parameters:
random- the random number generator to use- Returns:
- a random value that has already been generated
-
getType
- Specified by:
getTypein interfaceTestDataGenerator<Short,Short> - Returns:
- the type of the chunk that we populate
-
getColumnType
- Specified by:
getColumnTypein interfaceTestDataGenerator<Short,Short> - Returns:
- the type of the generated column
-