Class AbstractSortedGenerator<T extends Comparable<? super T>>
java.lang.Object
io.deephaven.engine.testutil.generator.AbstractSortedGenerator<T>
- All Implemented Interfaces:
TestDataGenerator<T,T>
- Direct Known Subclasses:
DateGenerator,SortedBigIntegerGenerator,SortedDateTimeGenerator
public abstract class AbstractSortedGenerator<T extends Comparable<? super T>>
extends Object
implements TestDataGenerator<T,T>
Generates a sorted column of objects.
Some query operations require sorted values as input, the sorted generators creates columns that are in sorted order.
Internally, an Index of current values plus a hashmap of those values is maintained. When new rows are added, the
values are randomly selected between the prior and next point.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonRemove(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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.deephaven.engine.testutil.generator.TestDataGenerator
getType
-
Constructor Details
-
AbstractSortedGenerator
public AbstractSortedGenerator()
-
-
Method Details
-
populateChunk
Description copied from interface:TestDataGeneratorCreate a chunk for the given index using random for any desired entropy.- Specified by:
populateChunkin interfaceTestDataGenerator<T extends Comparable<? super T>,T extends Comparable<? super T>> - 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
-
getColumnType
- Specified by:
getColumnTypein interfaceTestDataGenerator<T extends Comparable<? super T>,T extends Comparable<? super T>> - Returns:
- the type of the generated column
-
onRemove
Description copied from interface:TestDataGeneratorCalled after a key has been removed from the map.- Specified by:
onRemovein interfaceTestDataGenerator<T extends Comparable<? super T>,T extends Comparable<? super T>> - 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<T extends Comparable<? super T>,T extends Comparable<? super T>> - Parameters:
start- the start of the range to shiftend- the end of the range to shiftdelta- the delta for the shift
-