Class HashInterval
java.lang.Object
io.nosqlbench.virtdata.library.basics.shared.from_long.to_long.HashInterval
- All Implemented Interfaces:
LongUnaryOperator
Return a value within a range, pseudo-randomly, using interval semantics,
where the range of values return does not include the last value.
This function behaves exactly like HashRange except for the exclusion
of the last value. This allows you to stack intervals using known
reference points without duplicating or skipping any given value.
You can specify hash intervals as small as a single-element range, like
(5,6), or as wide as the relevant data type allows.
-
Constructor Summary
ConstructorsConstructorDescriptionHashInterval(long width) Create a hash interval based on a minimum value of 0 and a specified width.HashInterval(long minIncl, long maxExcl) Create a hash interval -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.LongUnaryOperator
andThen, compose
-
Constructor Details
-
HashInterval
public HashInterval(long width) Create a hash interval based on a minimum value of 0 and a specified width.- Parameters:
width- The maximum value, which is excluded.
-
HashInterval
public HashInterval(long minIncl, long maxExcl) Create a hash interval- Parameters:
minIncl- The minimum value, which is includedmaxExcl- The maximum value, which is excluded
-
-
Method Details
-
applyAsLong
public long applyAsLong(long operand) - Specified by:
applyAsLongin interfaceLongUnaryOperator
-