Package io.deephaven.function
Class Basic
java.lang.Object
io.deephaven.function.Basic
Basic functions that can be applied to primitive types.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]array(ByteVector values) Converts a Deephaven vector to a primitive array that may be freely mutated by the caller.static char[]array(CharVector values) Converts a Deephaven vector to a primitive array that may be freely mutated by the caller.static double[]array(DoubleVector values) Converts a Deephaven vector to a primitive array that may be freely mutated by the caller.static float[]array(FloatVector values) Converts a Deephaven vector to a primitive array that may be freely mutated by the caller.static int[]Converts a Deephaven vector to a primitive array that may be freely mutated by the caller.static long[]array(LongVector values) Converts a Deephaven vector to a primitive array that may be freely mutated by the caller.static short[]array(ShortVector values) Converts a Deephaven vector to a primitive array that may be freely mutated by the caller.static <T> T[]arrayObj(ObjectVector<T> values) Converts a Deephaven vector to an array that may be freely mutated by the caller.static byte[]concat(byte[]... values) Returns the concatenation of multiple arrays into a single array.static char[]concat(char[]... values) Returns the concatenation of multiple arrays into a single array.static double[]concat(double[]... values) Returns the concatenation of multiple arrays into a single array.static float[]concat(float[]... values) Returns the concatenation of multiple arrays into a single array.static int[]concat(int[]... values) Returns the concatenation of multiple arrays into a single array.static long[]concat(long[]... values) Returns the concatenation of multiple arrays into a single array.static short[]concat(short[]... values) Returns the concatenation of multiple arrays into a single array.static byte[]concat(ByteVector... values) Returns the concatenation of multiple arrays into a single array.static char[]concat(CharVector... values) Returns the concatenation of multiple arrays into a single array.static double[]concat(DoubleVector... values) Returns the concatenation of multiple arrays into a single array.static float[]concat(FloatVector... values) Returns the concatenation of multiple arrays into a single array.static int[]Returns the concatenation of multiple arrays into a single array.static long[]concat(LongVector... values) Returns the concatenation of multiple arrays into a single array.static <T> T[]concat(ObjectVector<T>... values) Returns the concatenation of multiple arrays into a single array.static short[]concat(ShortVector... values) Returns the concatenation of multiple arrays into a single array.static <T> T[]concat(T[]... values) Returns the concatenation of multiple arrays into a single array.static longcount(byte... values) Counts the number of non-null values.static longcount(char... values) Counts the number of non-null values.static longcount(double... values) Counts the number of non-null values.static longcount(float... values) Counts the number of non-null values.static longcount(int... values) Counts the number of non-null values.static longcount(long... values) Counts the number of non-null values.static longcount(short... values) Counts the number of non-null values.static longcount(ByteVector values) Counts the number of non-null values.static longcount(CharVector values) Counts the number of non-null values.static longcount(DoubleVector values) Counts the number of non-null values.static longcount(FloatVector values) Counts the number of non-null values.static longCounts the number of non-null values.static longcount(LongVector values) Counts the number of non-null values.static longcount(ShortVector values) Counts the number of non-null values.static longcountDistinct(byte... values) Counts the number of distinct elements in the array.static longcountDistinct(byte[] values, boolean countNull) Counts the number of distinct elements in the array.static longcountDistinct(char... values) Counts the number of distinct elements in the array.static longcountDistinct(char[] values, boolean countNull) Counts the number of distinct elements in the array.static longcountDistinct(double... values) Counts the number of distinct elements in the array.static longcountDistinct(double[] values, boolean countNull) Counts the number of distinct elements in the array.static longcountDistinct(float... values) Counts the number of distinct elements in the array.static longcountDistinct(float[] values, boolean countNull) Counts the number of distinct elements in the array.static longcountDistinct(int... values) Counts the number of distinct elements in the array.static longcountDistinct(int[] values, boolean countNull) Counts the number of distinct elements in the array.static longcountDistinct(long... values) Counts the number of distinct elements in the array.static longcountDistinct(long[] values, boolean countNull) Counts the number of distinct elements in the array.static longcountDistinct(short... values) Counts the number of distinct elements in the array.static longcountDistinct(short[] values, boolean countNull) Counts the number of distinct elements in the array.static longcountDistinct(ByteVector values) Counts the number of distinct elements in the array.static longcountDistinct(ByteVector values, boolean countNull) Counts the number of distinct elements in the array.static longcountDistinct(CharVector values) Counts the number of distinct elements in the array.static longcountDistinct(CharVector values, boolean countNull) Counts the number of distinct elements in the array.static longcountDistinct(DoubleVector values) Counts the number of distinct elements in the array.static longcountDistinct(DoubleVector values, boolean countNull) Counts the number of distinct elements in the array.static longcountDistinct(FloatVector values) Counts the number of distinct elements in the array.static longcountDistinct(FloatVector values, boolean countNull) Counts the number of distinct elements in the array.static longcountDistinct(IntVector values) Counts the number of distinct elements in the array.static longcountDistinct(IntVector values, boolean countNull) Counts the number of distinct elements in the array.static longcountDistinct(LongVector values) Counts the number of distinct elements in the array.static longcountDistinct(LongVector values, boolean countNull) Counts the number of distinct elements in the array.static longcountDistinct(ShortVector values) Counts the number of distinct elements in the array.static longcountDistinct(ShortVector values, boolean countNull) Counts the number of distinct elements in the array.static <T extends Comparable<? super T>>
longcountDistinctObj(ObjectVector<T> values) Counts the number of distinct elements in the array.static <T extends Comparable<? super T>>
longcountDistinctObj(ObjectVector<T> values, boolean countNull) Counts the number of distinct elements in the array.static <T extends Comparable<? super T>>
longcountDistinctObj(T... values) Counts the number of distinct elements in the array.static <T extends Comparable<? super T>>
longcountDistinctObj(T[] values, boolean countNull) Counts the number of distinct elements in the array.static <T> longcountObj(ObjectVector<T> values) Counts the number of non-null values.static <T> longcountObj(T... values) Counts the number of non-null values.static byte[]distinct(byte... values) Returns an array containing only the distinct values from the input.static byte[]distinct(byte[] values, boolean includeNull) Returns an array containing only the distinct values from the input.static char[]distinct(char... values) Returns an array containing only the distinct values from the input.static char[]distinct(char[] values, boolean includeNull) Returns an array containing only the distinct values from the input.static double[]distinct(double... values) Returns an array containing only the distinct values from the input.static double[]distinct(double[] values, boolean includeNull) Returns an array containing only the distinct values from the input.static float[]distinct(float... values) Returns an array containing only the distinct values from the input.static float[]distinct(float[] values, boolean includeNull) Returns an array containing only the distinct values from the input.static int[]distinct(int... values) Returns an array containing only the distinct values from the input.static int[]distinct(int[] values, boolean includeNull) Returns an array containing only the distinct values from the input.static long[]distinct(long... values) Returns an array containing only the distinct values from the input.static long[]distinct(long[] values, boolean includeNull) Returns an array containing only the distinct values from the input.static short[]distinct(short... values) Returns an array containing only the distinct values from the input.static short[]distinct(short[] values, boolean includeNull) Returns an array containing only the distinct values from the input.static byte[]distinct(ByteVector values) Returns an array containing only the distinct values from the input.static byte[]distinct(ByteVector values, boolean includeNull) Returns an array containing only the distinct values from the input.static char[]distinct(CharVector values) Returns an array containing only the distinct values from the input.static char[]distinct(CharVector values, boolean includeNull) Returns an array containing only the distinct values from the input.static double[]distinct(DoubleVector values) Returns an array containing only the distinct values from the input.static double[]distinct(DoubleVector values, boolean includeNull) Returns an array containing only the distinct values from the input.static float[]distinct(FloatVector values) Returns an array containing only the distinct values from the input.static float[]distinct(FloatVector values, boolean includeNull) Returns an array containing only the distinct values from the input.static int[]Returns an array containing only the distinct values from the input.static int[]Returns an array containing only the distinct values from the input.static long[]distinct(LongVector values) Returns an array containing only the distinct values from the input.static long[]distinct(LongVector values, boolean includeNull) Returns an array containing only the distinct values from the input.static short[]distinct(ShortVector values) Returns an array containing only the distinct values from the input.static short[]distinct(ShortVector values, boolean includeNull) Returns an array containing only the distinct values from the input.static <T extends Comparable<? super T>>
T[]distinctObj(ObjectVector<T> values) Returns an array containing only the distinct values from the input.static <T extends Comparable<? super T>>
T[]distinctObj(ObjectVector<T> values, boolean includeNull) Returns an array containing only the distinct values from the input.static <T extends Comparable<? super T>>
T[]distinctObj(T... values) Returns an array containing only the distinct values from the input.static <T extends Comparable<? super T>>
T[]distinctObj(T[] values, boolean includeNull) Returns an array containing only the distinct values from the input.static byte[]enlist(byte... values) Returns a list containing its arguments.static char[]enlist(char... values) Returns a list containing its arguments.static double[]enlist(double... values) Returns a list containing its arguments.static float[]enlist(float... values) Returns a list containing its arguments.static int[]enlist(int... values) Returns a list containing its arguments.static long[]enlist(long... values) Returns a list containing its arguments.static short[]enlist(short... values) Returns a list containing its arguments.static bytefirst(byte... values) Returns the first value from an array.static charfirst(char... values) Returns the first value from an array.static doublefirst(double... values) Returns the first value from an array.static floatfirst(float... values) Returns the first value from an array.static intfirst(int... values) Returns the first value from an array.static longfirst(long... values) Returns the first value from an array.static shortfirst(short... values) Returns the first value from an array.static bytefirst(ByteVector values) Returns the first value from an array.static charfirst(CharVector values) Returns the first value from an array.static doublefirst(DoubleVector values) Returns the first value from an array.static floatfirst(FloatVector values) Returns the first value from an array.static intReturns the first value from an array.static longfirst(LongVector values) Returns the first value from an array.static shortfirst(ShortVector values) Returns the first value from an array.static longfirstIndexOf(byte val, byte... values) Returns the first index containing the value.static longfirstIndexOf(byte val, ByteVector values) Returns the first index containing the value.static longfirstIndexOf(char val, char... values) Returns the first index containing the value.static longfirstIndexOf(char val, CharVector values) Returns the first index containing the value.static longfirstIndexOf(double val, double... values) Returns the first index containing the value.static longfirstIndexOf(double val, DoubleVector values) Returns the first index containing the value.static longfirstIndexOf(float val, float... values) Returns the first index containing the value.static longfirstIndexOf(float val, FloatVector values) Returns the first index containing the value.static longfirstIndexOf(int val, int... values) Returns the first index containing the value.static longfirstIndexOf(int val, IntVector values) Returns the first index containing the value.static longfirstIndexOf(long val, long... values) Returns the first index containing the value.static longfirstIndexOf(long val, LongVector values) Returns the first index containing the value.static longfirstIndexOf(short val, short... values) Returns the first index containing the value.static longfirstIndexOf(short val, ShortVector values) Returns the first index containing the value.static <T> longfirstIndexOfObj(T val, ObjectVector<T> values) Returns the first index containing the value.static <T> longfirstIndexOfObj(T val, T... values) Returns the first index containing the value.static <T> TfirstObj(ObjectVector<T> values) Returns the first value from an array.static <T> TfirstObj(T... values) Returns the first value from an array.static byte[]forwardFill(byte... values) Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists.static char[]forwardFill(char... values) Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists.static double[]forwardFill(double... values) Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists.static float[]forwardFill(float... values) Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists.static int[]forwardFill(int... values) Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists.static long[]forwardFill(long... values) Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists.static short[]forwardFill(short... values) Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists.static byte[]forwardFill(ByteVector values) Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists.static char[]forwardFill(CharVector values) Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists.static double[]forwardFill(DoubleVector values) Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists.static float[]forwardFill(FloatVector values) Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists.static int[]forwardFill(IntVector values) Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists.static long[]forwardFill(LongVector values) Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists.static short[]forwardFill(ShortVector values) Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists.static <T> T[]forwardFillObj(ObjectVector<T> values) Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists.static <T> T[]forwardFillObj(T... values) Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists.static byte[]ifelse(ObjectVector<Boolean> condition, byte trueCase, byte falseCase) Returns elements from either trueCase or falseCase, depending on condition.static char[]ifelse(ObjectVector<Boolean> condition, char trueCase, char falseCase) Returns elements from either trueCase or falseCase, depending on condition.static double[]ifelse(ObjectVector<Boolean> condition, double trueCase, double falseCase) Returns elements from either trueCase or falseCase, depending on condition.static float[]ifelse(ObjectVector<Boolean> condition, float trueCase, float falseCase) Returns elements from either trueCase or falseCase, depending on condition.static int[]ifelse(ObjectVector<Boolean> condition, int trueCase, int falseCase) Returns elements from either trueCase or falseCase, depending on condition.static long[]ifelse(ObjectVector<Boolean> condition, long trueCase, long falseCase) Returns elements from either trueCase or falseCase, depending on condition.static short[]ifelse(ObjectVector<Boolean> condition, short trueCase, short falseCase) Returns elements from either trueCase or falseCase, depending on condition.static byte[]ifelse(ObjectVector<Boolean> condition, ByteVector trueCase, ByteVector falseCase) Returns elements from either trueCase or falseCase, depending on condition.static char[]ifelse(ObjectVector<Boolean> condition, CharVector trueCase, CharVector falseCase) Returns elements from either trueCase or falseCase, depending on condition.static double[]ifelse(ObjectVector<Boolean> condition, DoubleVector trueCase, DoubleVector falseCase) Returns elements from either trueCase or falseCase, depending on condition.static float[]ifelse(ObjectVector<Boolean> condition, FloatVector trueCase, FloatVector falseCase) Returns elements from either trueCase or falseCase, depending on condition.static int[]ifelse(ObjectVector<Boolean> condition, IntVector trueCase, IntVector falseCase) Returns elements from either trueCase or falseCase, depending on condition.static long[]ifelse(ObjectVector<Boolean> condition, LongVector trueCase, LongVector falseCase) Returns elements from either trueCase or falseCase, depending on condition.static short[]ifelse(ObjectVector<Boolean> condition, ShortVector trueCase, ShortVector falseCase) Returns elements from either trueCase or falseCase, depending on condition.static byte[]Returns elements from either trueCase or falseCase, depending on condition.static byte[]Returns elements from either trueCase or falseCase, depending on condition.static char[]Returns elements from either trueCase or falseCase, depending on condition.static char[]Returns elements from either trueCase or falseCase, depending on condition.static double[]Returns elements from either trueCase or falseCase, depending on condition.static double[]Returns elements from either trueCase or falseCase, depending on condition.static float[]Returns elements from either trueCase or falseCase, depending on condition.static float[]Returns elements from either trueCase or falseCase, depending on condition.static int[]Returns elements from either trueCase or falseCase, depending on condition.static int[]Returns elements from either trueCase or falseCase, depending on condition.static long[]Returns elements from either trueCase or falseCase, depending on condition.static long[]Returns elements from either trueCase or falseCase, depending on condition.static short[]Returns elements from either trueCase or falseCase, depending on condition.static short[]Returns elements from either trueCase or falseCase, depending on condition.static byteReturns elements from either trueCase or falseCase, depending on condition.static charReturns elements from either trueCase or falseCase, depending on condition.static doubleReturns elements from either trueCase or falseCase, depending on condition.static floatReturns elements from either trueCase or falseCase, depending on condition.static intReturns elements from either trueCase or falseCase, depending on condition.static longReturns elements from either trueCase or falseCase, depending on condition.static shortReturns elements from either trueCase or falseCase, depending on condition.static <T> T[]ifelseObj(ObjectVector<Boolean> condition, ObjectVector<T> trueCase, ObjectVector<T> falseCase) Returns elements from either trueCase or falseCase, depending on condition.static <T> T[]ifelseObj(ObjectVector<Boolean> condition, T trueCase, T falseCase) Returns elements from either trueCase or falseCase, depending on condition.static <T> T[]Returns elements from either trueCase or falseCase, depending on condition.static <T> T[]Returns elements from either trueCase or falseCase, depending on condition.static <T> TReturns elements from either trueCase or falseCase, depending on condition.static booleanin(byte testedValues, byte... possibleValues) Checks if a value is within a discrete set of possible values.static booleanin(char testedValues, char... possibleValues) Checks if a value is within a discrete set of possible values.static booleanin(double testedValues, double... possibleValues) Checks if a value is within a discrete set of possible values.static booleanin(float testedValues, float... possibleValues) Checks if a value is within a discrete set of possible values.static booleanin(int testedValues, int... possibleValues) Checks if a value is within a discrete set of possible values.static booleanin(long testedValues, long... possibleValues) Checks if a value is within a discrete set of possible values.static booleanin(short testedValues, short... possibleValues) Checks if a value is within a discrete set of possible values.static <T> booleaninObj(T testedValue, ObjectVector<T> possibleValues) Checks if a value is within a discrete set of possible values.static <T> booleaninObj(T testedValue, T... possibleValues) Checks if a value is within a discrete set of possible values.static booleaninRange(byte testedValue, byte lowInclusiveValue, byte highInclusiveValue) Checks if a value is within a range.static booleaninRange(char testedValue, char lowInclusiveValue, char highInclusiveValue) Checks if a value is within a range.static booleaninRange(double testedValue, double lowInclusiveValue, double highInclusiveValue) Checks if a value is within a range.static booleaninRange(float testedValue, float lowInclusiveValue, float highInclusiveValue) Checks if a value is within a range.static booleaninRange(int testedValue, int lowInclusiveValue, int highInclusiveValue) Checks if a value is within a range.static booleaninRange(long testedValue, long lowInclusiveValue, long highInclusiveValue) Checks if a value is within a range.static booleaninRange(short testedValue, short lowInclusiveValue, short highInclusiveValue) Checks if a value is within a range.static <T extends Comparable<? super T>>
booleaninRange(T testedValue, T lowInclusiveValue, T highInclusiveValue) Checks if a value is within a range.static booleanisNull(byte value) Determines if a value is considered by the Deephaven convention to be null.static booleanisNull(char value) Determines if a value is considered by the Deephaven convention to be null.static booleanisNull(double value) Determines if a value is considered by the Deephaven convention to be null.static booleanisNull(float value) Determines if a value is considered by the Deephaven convention to be null.static booleanisNull(int value) Determines if a value is considered by the Deephaven convention to be null.static booleanisNull(long value) Determines if a value is considered by the Deephaven convention to be null.static booleanisNull(short value) Determines if a value is considered by the Deephaven convention to be null.static <T> booleanisNull(T value) Determines if a value is considered by the Deephaven convention to be null.static bytelast(byte... values) Returns the last value from an array.static charlast(char... values) Returns the last value from an array.static doublelast(double... values) Returns the last value from an array.static floatlast(float... values) Returns the last value from an array.static intlast(int... values) Returns the last value from an array.static longlast(long... values) Returns the last value from an array.static shortlast(short... values) Returns the last value from an array.static bytelast(ByteVector values) Returns the last value from an array.static charlast(CharVector values) Returns the last value from an array.static doublelast(DoubleVector values) Returns the last value from an array.static floatlast(FloatVector values) Returns the last value from an array.static intReturns the last value from an array.static longlast(LongVector values) Returns the last value from an array.static shortlast(ShortVector values) Returns the last value from an array.static <T> TlastObj(ObjectVector<T> values) Returns the last value from an array.static <T> TlastObj(T... values) Returns the last value from an array.static longlen(byte[] values) Returns the length of the input.static longlen(char[] values) Returns the length of the input.static longlen(double[] values) Returns the length of the input.static longlen(float[] values) Returns the length of the input.static longlen(int[] values) Returns the length of the input.static longlen(long[] values) Returns the length of the input.static longlen(short[] values) Returns the length of the input.static longlen(LongSizedDataStructure values) Returns the length of the input.static <T> longlen(T[] values) Returns the length of the input.static bytenth(long index, byte... values) Returns the nth value from an array.static charnth(long index, char... values) Returns the nth value from an array.static doublenth(long index, double... values) Returns the nth value from an array.static floatnth(long index, float... values) Returns the nth value from an array.static intnth(long index, int... values) Returns the nth value from an array.static longnth(long index, long... values) Returns the nth value from an array.static shortnth(long index, short... values) Returns the nth value from an array.static bytenth(long index, ByteVector values) Returns the nth value from an array.static charnth(long index, CharVector values) Returns the nth value from an array.static doublenth(long index, DoubleVector values) Returns the nth value from an array.static floatnth(long index, FloatVector values) Returns the nth value from an array.static intReturns the nth value from an array.static longnth(long index, LongVector values) Returns the nth value from an array.static shortnth(long index, ShortVector values) Returns the nth value from an array.static <T> TnthObj(long index, ObjectVector<T> values) Returns the nth value from an array.static <T> TnthObj(long index, T... values) Returns the nth value from an array.static <T> TnullValueFor(Class<T> clazz) Returns the null value in the Deephaven convention that corresponds to type T.static byte[]repeat(byte value, int size) Returns an array with a value repeated.static char[]repeat(char value, int size) Returns an array with a value repeated.static double[]repeat(double value, int size) Returns an array with a value repeated.static float[]repeat(float value, int size) Returns an array with a value repeated.static int[]repeat(int value, int size) Returns an array with a value repeated.static long[]repeat(long value, int size) Returns an array with a value repeated.static short[]repeat(short value, int size) Returns an array with a value repeated.static <T> T[]repeat(T value, int size) Returns an array with a value repeated.static byte[]replaceIfNull(byte[] values, byte replacement) Replaces values that are null according to Deephaven convention with a specified value.static bytereplaceIfNull(byte value, byte replacement) Replaces values that are null according to Deephaven convention with a specified value.static char[]replaceIfNull(char[] values, char replacement) Replaces values that are null according to Deephaven convention with a specified value.static charreplaceIfNull(char value, char replacement) Replaces values that are null according to Deephaven convention with a specified value.static double[]replaceIfNull(double[] values, double replacement) Replaces values that are null according to Deephaven convention with a specified value.static doublereplaceIfNull(double value, double replacement) Replaces values that are null according to Deephaven convention with a specified value.static float[]replaceIfNull(float[] values, float replacement) Replaces values that are null according to Deephaven convention with a specified value.static floatreplaceIfNull(float value, float replacement) Replaces values that are null according to Deephaven convention with a specified value.static int[]replaceIfNull(int[] values, int replacement) Replaces values that are null according to Deephaven convention with a specified value.static intreplaceIfNull(int value, int replacement) Replaces values that are null according to Deephaven convention with a specified value.static long[]replaceIfNull(long[] values, long replacement) Replaces values that are null according to Deephaven convention with a specified value.static longreplaceIfNull(long value, long replacement) Replaces values that are null according to Deephaven convention with a specified value.static short[]replaceIfNull(short[] values, short replacement) Replaces values that are null according to Deephaven convention with a specified value.static shortreplaceIfNull(short value, short replacement) Replaces values that are null according to Deephaven convention with a specified value.static byte[]replaceIfNull(ByteVector values, byte replacement) Replaces values that are null according to Deephaven convention with a specified value.static char[]replaceIfNull(CharVector values, char replacement) Replaces values that are null according to Deephaven convention with a specified value.static double[]replaceIfNull(DoubleVector values, double replacement) Replaces values that are null according to Deephaven convention with a specified value.static float[]replaceIfNull(FloatVector values, float replacement) Replaces values that are null according to Deephaven convention with a specified value.static int[]replaceIfNull(IntVector values, int replacement) Replaces values that are null according to Deephaven convention with a specified value.static long[]replaceIfNull(LongVector values, long replacement) Replaces values that are null according to Deephaven convention with a specified value.static <T> T[]replaceIfNull(ObjectVector<T> values, T replacement) Replaces values that are null according to Deephaven convention with a specified value.static short[]replaceIfNull(ShortVector values, short replacement) Replaces values that are null according to Deephaven convention with a specified value.static <T> T[]replaceIfNull(T[] values, T replacement) Replaces values that are null according to Deephaven convention with a specified value.static <T> TreplaceIfNull(T value, T replacement) Replaces values that are null according to Deephaven convention with a specified value.static byte[]reverse(byte... values) Returns an array with the values reversed.static char[]reverse(char... values) Returns an array with the values reversed.static double[]reverse(double... values) Returns an array with the values reversed.static float[]reverse(float... values) Returns an array with the values reversed.static int[]reverse(int... values) Returns an array with the values reversed.static long[]reverse(long... values) Returns an array with the values reversed.static short[]reverse(short... values) Returns an array with the values reversed.static byte[]reverse(ByteVector values) Returns an array with the values reversed.static char[]reverse(CharVector values) Returns an array with the values reversed.static double[]reverse(DoubleVector values) Returns an array with the values reversed.static float[]reverse(FloatVector values) Returns an array with the values reversed.static int[]Returns an array with the values reversed.static long[]reverse(LongVector values) Returns an array with the values reversed.static short[]reverse(ShortVector values) Returns an array with the values reversed.static <T> T[]reverseObj(ObjectVector<T> values) Returns an array with the values reversed.static <T> T[]reverseObj(T... values) Returns an array with the values reversed.static byte[]Unboxes an array of values.static char[]Unboxes an array of values.static double[]Unboxes an array of values.static float[]Unboxes an array of values.static int[]Unboxes an array of values.static long[]Unboxes an array of values.static short[]Unboxes an array of values.static ByteVectorvec(byte... values) Converts a primitive array to a Deephaven vector.static CharVectorvec(char... values) Converts a primitive array to a Deephaven vector.static DoubleVectorvec(double... values) Converts a primitive array to a Deephaven vector.static FloatVectorvec(float... values) Converts a primitive array to a Deephaven vector.static IntVectorvec(int... values) Converts a primitive array to a Deephaven vector.static LongVectorvec(long... values) Converts a primitive array to a Deephaven vector.static ShortVectorvec(short... values) Converts a primitive array to a Deephaven vector.static <T> ObjectVector<T>vecObj(T... values) Converts an array to a Deephaven vector.
-
Constructor Details
-
Basic
public Basic()
-
-
Method Details
-
nullValueFor
Returns the null value in the Deephaven convention that corresponds to type T.- Parameters:
clazz- The type.- Returns:
- The corresponding null value in the Deephaven convention if T is one of the Deephaven types with a distinguished null value. Otherwise, null,
-
isNull
public static <T> boolean isNull(T value) Determines if a value is considered by the Deephaven convention to be null. In the Deephaven convention, every simple type T has a special distinguished value NULL_T which is used to represent the null value for that type. These values are enumerated in theQueryConstantsclass.- Parameters:
value- value.- Returns:
- true if the value is null according to the Deephaven convention, and false otherwise.
-
replaceIfNull
public static <T> T replaceIfNull(T value, T replacement) Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
value- value.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- value, if value is not null according to Deephaven convention, replacement otherwise.
-
replaceIfNull
public static <T> T[] replaceIfNull(T[] values, T replacement) Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
values- the values.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- array containing value, if value is not null according to Deephaven convention, replacement otherwise.
-
replaceIfNull
Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
values- the values.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- array containing value, if value is not null according to Deephaven convention, replacement otherwise.
-
len
public static <T> long len(T[] values) Returns the length of the input.- Parameters:
values- values.- Returns:
- length of the input or the Deephaven null constant for null inputs.
-
len
Returns the length of the input.- Parameters:
values- values.- Returns:
- length of the input or the Deephaven null constant for null inputs.
-
countObj
Counts the number of non-null values.- Parameters:
values- values.- Returns:
- number of non-null values.
-
countObj
Counts the number of non-null values.- Parameters:
values- values.- Returns:
- number of non-null values.
-
lastObj
Returns the last value from an array.- Parameters:
values- values.- Returns:
- last value from the array.
-
lastObj
Returns the last value from an array.- Parameters:
values- values.- Returns:
- last value from the array.
-
firstObj
Returns the first value from an array.- Parameters:
values- values.- Returns:
- first value from the array.
-
firstObj
Returns the first value from an array.- Parameters:
values- values.- Returns:
- first value from the array.
-
nthObj
Returns the nth value from an array.- Parameters:
index- index of the value to return.values- values.- Returns:
- nth value from the array or null, if the index is outside of the array's index range.
-
nthObj
Returns the nth value from an array.- Parameters:
index- index of the value to return.values- values.- Returns:
- nth value from the array or null, if the index is outside of the array's index range.
-
arrayObj
Converts a Deephaven vector to an array that may be freely mutated by the caller.- Parameters:
values- A Deephaven vector- Returns:
- The result array, which may be freely mutated by the caller
-
vecObj
Converts an array to a Deephaven vector.- Parameters:
values- primitive array- Returns:
- Deephaven vector.
-
inRange
public static <T extends Comparable<? super T>> boolean inRange(T testedValue, T lowInclusiveValue, T highInclusiveValue) Checks if a value is within a range.- Parameters:
testedValue- tested value.lowInclusiveValue- lower inclusive bound of the range.highInclusiveValue- upper inclusive bound of the range.- Returns:
- true if the tested value is within the range, and false if the tested value is not in the range or is null.
-
inObj
Checks if a value is within a discrete set of possible values.- Parameters:
testedValue- tested value.possibleValues- possible values.- Returns:
- true if the tested value is contained in the possible values, and false otherwise.
-
inObj
Checks if a value is within a discrete set of possible values.- Parameters:
testedValue- tested value.possibleValues- possible values.- Returns:
- true if the tested value is contained in the possible values, and false otherwise.
-
countDistinctObj
Counts the number of distinct elements in the array.- Parameters:
values- values.- Returns:
- number of distinct non-null values.
-
countDistinctObj
Counts the number of distinct elements in the array.- Parameters:
values- values.- Returns:
- number of distinct non-null values.
-
countDistinctObj
public static <T extends Comparable<? super T>> long countDistinctObj(T[] values, boolean countNull) Counts the number of distinct elements in the array.- Parameters:
values- values.countNull- true to count null values, and false to exclude null values.- Returns:
- number of distinct values.
-
countDistinctObj
public static <T extends Comparable<? super T>> long countDistinctObj(ObjectVector<T> values, boolean countNull) Counts the number of distinct elements in the array.- Parameters:
values- values.countNull- true to count null values, and false to exclude null values.- Returns:
- number of distinct values.
-
distinctObj
Returns an array containing only the distinct values from the input.- Parameters:
values- values.- Returns:
- unsorted array containing only distinct non-null items from arr.
-
distinctObj
Returns an array containing only the distinct values from the input.- Parameters:
values- values.- Returns:
- unsorted array containing only distinct non-null items from arr.
-
distinctObj
Returns an array containing only the distinct values from the input.- Parameters:
values- values.includeNull- true to include null values, and false to exclude null values.- Returns:
- array containing only distinct items from arr.
-
distinctObj
public static <T extends Comparable<? super T>> T[] distinctObj(ObjectVector<T> values, boolean includeNull) Returns an array containing only the distinct values from the input.- Parameters:
values- values.includeNull- true to include null values, and false to exclude null values.- Returns:
- array containing only distinct items from arr.
-
repeat
public static <T> T[] repeat(T value, int size) Returns an array with a value repeated.- Parameters:
value- value.size- number of times to repeat the value.- Returns:
- array of repeated values. If
sizeis less than or equal to zero, an empty array is returned.
-
concat
Returns the concatenation of multiple arrays into a single array.- Parameters:
values- values.- Returns:
- concatenation of multiple arrays into a single array.
-
concat
Returns the concatenation of multiple arrays into a single array.- Parameters:
values- values.- Returns:
- concatenation of multiple arrays into a single array.
-
reverseObj
Returns an array with the values reversed.- Parameters:
values- values.- Returns:
- array with the values reversed.
-
reverseObj
Returns an array with the values reversed.- Parameters:
values- values.- Returns:
- array with the values reversed.
-
firstIndexOfObj
Returns the first index containing the value.- Parameters:
values- values.val- value to search for.- Returns:
- first index containing the value or null, if the value is not present.
-
firstIndexOfObj
Returns the first index containing the value.- Parameters:
values- values.val- value to search for.- Returns:
- first index containing the value or null, if the value is not present.
-
ifelseObj
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- trueCase value if condition is true, falseCase value if condition is false, or null if condition is null.
-
ifelseObj
public static <T> T[] ifelseObj(ObjectVector<Boolean> condition, ObjectVector<T> trueCase, ObjectVector<T> falseCase) Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of T whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be the trueCase element if the condition element is true; the falseCase element if the condition element is false; or null if the condition element is null. Returns null if any of the inputs is null.
-
ifelseObj
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of T whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be the trueCase element if the condition element is true; the falseCase element if the condition element is false; or null if the condition element is null. Returns null if any of the inputs is null.
-
ifelseObj
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of T whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be trueCase if the condition element is true; falseCase if the condition element is false; or null if the condition element is null. Returns null if condition is null.
-
ifelseObj
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of T whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be trueCase if the condition element is true; falseCase if the condition element is false; or null if the condition element is null. Returns null if condition is null.
-
forwardFillObj
Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists. Otherwise (if no such value exists), replaces those elements with null.- Parameters:
values- values.- Returns:
- A copy of the specified array, with Deephaven null elements replaced as described above. If the specified array is null, returns null.
-
forwardFillObj
Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists. Otherwise (if no such value exists), replaces those elements with null.- Parameters:
values- values.- Returns:
- A copy of the specified array, with Deephaven null elements replaced as described above. If the specified array is null, returns null.
-
isNull
public static boolean isNull(char value) Determines if a value is considered by the Deephaven convention to be null. In the Deephaven convention, every simple type T has a special distinguished value NULL_T which is used to represent the null value for that type. These values are enumerated in theQueryConstantsclass.- Parameters:
value- value.- Returns:
- true if the value is null according to the Deephaven convention, and false otherwise.
-
unbox
Unboxes an array of values.- Parameters:
values- values.- Returns:
- unboxed array of values.
-
replaceIfNull
public static char replaceIfNull(char value, char replacement) Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
value- value.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- value, if value is not null according to Deephaven convention, replacement otherwise.
-
replaceIfNull
public static char[] replaceIfNull(char[] values, char replacement) Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
values- the values.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- array containing value, if value is not null according to Deephaven convention, replacement otherwise.
-
replaceIfNull
Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
values- the values.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- array containing value, if value is not null according to Deephaven convention, replacement otherwise.
-
len
public static long len(char[] values) Returns the length of the input.- Parameters:
values- values.- Returns:
- length of the input or the Deephaven null constant for null inputs.
-
count
public static long count(char... values) Counts the number of non-null values.- Parameters:
values- values.- Returns:
- number of non-null values.
-
count
Counts the number of non-null values.- Parameters:
values- values.- Returns:
- number of non-null values.
-
last
Returns the last value from an array.- Parameters:
values- values.- Returns:
- last value from the array.
-
last
public static char last(char... values) Returns the last value from an array.- Parameters:
values- values.- Returns:
- last value from the array.
-
first
Returns the first value from an array.- Parameters:
values- values.- Returns:
- first value from the array.
-
first
public static char first(char... values) Returns the first value from an array.- Parameters:
values- values.- Returns:
- first value from the array.
-
nth
Returns the nth value from an array.- Parameters:
index- index of the value to return.values- values.- Returns:
- nth value from the array or null, if the index is outside of the array's index range.
-
nth
public static char nth(long index, char... values) Returns the nth value from an array.- Parameters:
index- index of the value to return.values- values.- Returns:
- nth value from the array or null, if the index is outside of the array's index range.
-
array
Converts a Deephaven vector to a primitive array that may be freely mutated by the caller.- Parameters:
values- Deephaven vector- Returns:
- primitive array, which may be freely mutated by the caller
-
vec
Converts a primitive array to a Deephaven vector.- Parameters:
values- primitive array- Returns:
- Deephaven vector.
-
inRange
public static boolean inRange(char testedValue, char lowInclusiveValue, char highInclusiveValue) Checks if a value is within a range.- Parameters:
testedValue- tested value.lowInclusiveValue- lower inclusive bound of the range.highInclusiveValue- upper inclusive bound of the range.- Returns:
- true if the tested value is within the range, and false if the tested value is not in the range or is null.
-
in
public static boolean in(char testedValues, char... possibleValues) Checks if a value is within a discrete set of possible values.- Parameters:
testedValues- tested value.possibleValues- possible values.- Returns:
- true if the tested value is contained in the possible values, and false otherwise.
-
countDistinct
public static long countDistinct(char... values) Counts the number of distinct elements in the array.- Parameters:
values- values.- Returns:
- number of distinct non-null values.
-
countDistinct
Counts the number of distinct elements in the array.- Parameters:
values- values.- Returns:
- number of distinct non-null values.
-
countDistinct
public static long countDistinct(char[] values, boolean countNull) Counts the number of distinct elements in the array.- Parameters:
values- values.countNull- true to count null values, and false to exclude null values.- Returns:
- number of distinct values.
-
countDistinct
Counts the number of distinct elements in the array.- Parameters:
values- values.countNull- true to count null values, and false to exclude null values.- Returns:
- number of distinct values.
-
distinct
public static char[] distinct(char... values) Returns an array containing only the distinct values from the input.- Parameters:
values- values.- Returns:
- unsorted array containing only distinct non-null items from arr.
-
distinct
Returns an array containing only the distinct values from the input.- Parameters:
values- values.- Returns:
- unsorted array containing only distinct non-null items from arr.
-
distinct
public static char[] distinct(char[] values, boolean includeNull) Returns an array containing only the distinct values from the input.- Parameters:
values- values.includeNull- true to include null values, and false to exclude null values.- Returns:
- array containing only distinct items from arr.
-
distinct
Returns an array containing only the distinct values from the input.- Parameters:
values- values.includeNull- true to include null values, and false to exclude null values.- Returns:
- array containing only distinct items from arr.
-
repeat
public static char[] repeat(char value, int size) Returns an array with a value repeated.- Parameters:
value- value.size- number of times to repeat the value.- Returns:
- array of repeated values. If
sizeis less than zero, an empty array is returned.
-
enlist
public static char[] enlist(char... values) Returns a list containing its arguments.- Parameters:
values- values.- Returns:
- list containing values.
-
concat
public static char[] concat(char[]... values) Returns the concatenation of multiple arrays into a single array.- Parameters:
values- values.- Returns:
- concatenation of multiple arrays into a single array.
-
concat
Returns the concatenation of multiple arrays into a single array.- Parameters:
values- values.- Returns:
- concatenation of multiple arrays into a single array.
-
reverse
public static char[] reverse(char... values) Returns an array with the values reversed.- Parameters:
values- values.- Returns:
- array with the values reversed.
-
reverse
Returns an array with the values reversed.- Parameters:
values- values.- Returns:
- array with the values reversed.
-
firstIndexOf
public static long firstIndexOf(char val, char... values) Returns the first index containing the value.- Parameters:
values- values.val- value to search for.- Returns:
- first index containing the value or null, if the value is not present.
-
firstIndexOf
Returns the first index containing the value.- Parameters:
values- values.val- value to search for.- Returns:
- first index containing the value or null, if the value is not present.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- trueCase value if condition is true, falseCase value if condition is false, or the Deephaven null constant if condition is null.
-
ifelse
public static char[] ifelse(ObjectVector<Boolean> condition, CharVector trueCase, CharVector falseCase) Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of char whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be the trueCase element if the condition element is true; the falseCase element if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if any of the inputs is null.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of char whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be the trueCase element if the condition element is true; the falseCase element if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if any of the inputs is null.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of char whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be trueCase if the condition element is true; falseCase if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if condition is null.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of char whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be trueCase if the condition element is true; falseCase if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if condition is null.
-
forwardFill
public static char[] forwardFill(char... values) Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists. Otherwise (if no such value exists), replaces those elements with Deephaven null.- Parameters:
values- values.- Returns:
- A copy of the specified array, with Deephaven null elements replaced as described above. If the specified array is null, returns null.
-
forwardFill
Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists. Otherwise (if no such value exists), replaces those elements with Deephaven null.- Parameters:
values- values.- Returns:
- A copy of the specified array, with Deephaven null elements replaced as described above. If the specified array is null, returns null.
-
isNull
public static boolean isNull(byte value) Determines if a value is considered by the Deephaven convention to be null. In the Deephaven convention, every simple type T has a special distinguished value NULL_T which is used to represent the null value for that type. These values are enumerated in theQueryConstantsclass.- Parameters:
value- value.- Returns:
- true if the value is null according to the Deephaven convention, and false otherwise.
-
unbox
Unboxes an array of values.- Parameters:
values- values.- Returns:
- unboxed array of values.
-
replaceIfNull
public static byte replaceIfNull(byte value, byte replacement) Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
value- value.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- value, if value is not null according to Deephaven convention, replacement otherwise.
-
replaceIfNull
public static byte[] replaceIfNull(byte[] values, byte replacement) Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
values- the values.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- array containing value, if value is not null according to Deephaven convention, replacement otherwise.
-
replaceIfNull
Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
values- the values.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- array containing value, if value is not null according to Deephaven convention, replacement otherwise.
-
len
public static long len(byte[] values) Returns the length of the input.- Parameters:
values- values.- Returns:
- length of the input or the Deephaven null constant for null inputs.
-
count
public static long count(byte... values) Counts the number of non-null values.- Parameters:
values- values.- Returns:
- number of non-null values.
-
count
Counts the number of non-null values.- Parameters:
values- values.- Returns:
- number of non-null values.
-
last
Returns the last value from an array.- Parameters:
values- values.- Returns:
- last value from the array.
-
last
public static byte last(byte... values) Returns the last value from an array.- Parameters:
values- values.- Returns:
- last value from the array.
-
first
Returns the first value from an array.- Parameters:
values- values.- Returns:
- first value from the array.
-
first
public static byte first(byte... values) Returns the first value from an array.- Parameters:
values- values.- Returns:
- first value from the array.
-
nth
Returns the nth value from an array.- Parameters:
index- index of the value to return.values- values.- Returns:
- nth value from the array or null, if the index is outside of the array's index range.
-
nth
public static byte nth(long index, byte... values) Returns the nth value from an array.- Parameters:
index- index of the value to return.values- values.- Returns:
- nth value from the array or null, if the index is outside of the array's index range.
-
array
Converts a Deephaven vector to a primitive array that may be freely mutated by the caller.- Parameters:
values- Deephaven vector- Returns:
- primitive array, which may be freely mutated by the caller
-
vec
Converts a primitive array to a Deephaven vector.- Parameters:
values- primitive array- Returns:
- Deephaven vector.
-
inRange
public static boolean inRange(byte testedValue, byte lowInclusiveValue, byte highInclusiveValue) Checks if a value is within a range.- Parameters:
testedValue- tested value.lowInclusiveValue- lower inclusive bound of the range.highInclusiveValue- upper inclusive bound of the range.- Returns:
- true if the tested value is within the range, and false if the tested value is not in the range or is null.
-
in
public static boolean in(byte testedValues, byte... possibleValues) Checks if a value is within a discrete set of possible values.- Parameters:
testedValues- tested value.possibleValues- possible values.- Returns:
- true if the tested value is contained in the possible values, and false otherwise.
-
countDistinct
public static long countDistinct(byte... values) Counts the number of distinct elements in the array.- Parameters:
values- values.- Returns:
- number of distinct non-null values.
-
countDistinct
Counts the number of distinct elements in the array.- Parameters:
values- values.- Returns:
- number of distinct non-null values.
-
countDistinct
public static long countDistinct(byte[] values, boolean countNull) Counts the number of distinct elements in the array.- Parameters:
values- values.countNull- true to count null values, and false to exclude null values.- Returns:
- number of distinct values.
-
countDistinct
Counts the number of distinct elements in the array.- Parameters:
values- values.countNull- true to count null values, and false to exclude null values.- Returns:
- number of distinct values.
-
distinct
public static byte[] distinct(byte... values) Returns an array containing only the distinct values from the input.- Parameters:
values- values.- Returns:
- unsorted array containing only distinct non-null items from arr.
-
distinct
Returns an array containing only the distinct values from the input.- Parameters:
values- values.- Returns:
- unsorted array containing only distinct non-null items from arr.
-
distinct
public static byte[] distinct(byte[] values, boolean includeNull) Returns an array containing only the distinct values from the input.- Parameters:
values- values.includeNull- true to include null values, and false to exclude null values.- Returns:
- array containing only distinct items from arr.
-
distinct
Returns an array containing only the distinct values from the input.- Parameters:
values- values.includeNull- true to include null values, and false to exclude null values.- Returns:
- array containing only distinct items from arr.
-
repeat
public static byte[] repeat(byte value, int size) Returns an array with a value repeated.- Parameters:
value- value.size- number of times to repeat the value.- Returns:
- array of repeated values. If
sizeis less than zero, an empty array is returned.
-
enlist
public static byte[] enlist(byte... values) Returns a list containing its arguments.- Parameters:
values- values.- Returns:
- list containing values.
-
concat
public static byte[] concat(byte[]... values) Returns the concatenation of multiple arrays into a single array.- Parameters:
values- values.- Returns:
- concatenation of multiple arrays into a single array.
-
concat
Returns the concatenation of multiple arrays into a single array.- Parameters:
values- values.- Returns:
- concatenation of multiple arrays into a single array.
-
reverse
public static byte[] reverse(byte... values) Returns an array with the values reversed.- Parameters:
values- values.- Returns:
- array with the values reversed.
-
reverse
Returns an array with the values reversed.- Parameters:
values- values.- Returns:
- array with the values reversed.
-
firstIndexOf
public static long firstIndexOf(byte val, byte... values) Returns the first index containing the value.- Parameters:
values- values.val- value to search for.- Returns:
- first index containing the value or null, if the value is not present.
-
firstIndexOf
Returns the first index containing the value.- Parameters:
values- values.val- value to search for.- Returns:
- first index containing the value or null, if the value is not present.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- trueCase value if condition is true, falseCase value if condition is false, or the Deephaven null constant if condition is null.
-
ifelse
public static byte[] ifelse(ObjectVector<Boolean> condition, ByteVector trueCase, ByteVector falseCase) Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of byte whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be the trueCase element if the condition element is true; the falseCase element if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if any of the inputs is null.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of byte whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be the trueCase element if the condition element is true; the falseCase element if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if any of the inputs is null.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of byte whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be trueCase if the condition element is true; falseCase if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if condition is null.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of byte whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be trueCase if the condition element is true; falseCase if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if condition is null.
-
forwardFill
public static byte[] forwardFill(byte... values) Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists. Otherwise (if no such value exists), replaces those elements with Deephaven null.- Parameters:
values- values.- Returns:
- A copy of the specified array, with Deephaven null elements replaced as described above. If the specified array is null, returns null.
-
forwardFill
Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists. Otherwise (if no such value exists), replaces those elements with Deephaven null.- Parameters:
values- values.- Returns:
- A copy of the specified array, with Deephaven null elements replaced as described above. If the specified array is null, returns null.
-
isNull
public static boolean isNull(short value) Determines if a value is considered by the Deephaven convention to be null. In the Deephaven convention, every simple type T has a special distinguished value NULL_T which is used to represent the null value for that type. These values are enumerated in theQueryConstantsclass.- Parameters:
value- value.- Returns:
- true if the value is null according to the Deephaven convention, and false otherwise.
-
unbox
Unboxes an array of values.- Parameters:
values- values.- Returns:
- unboxed array of values.
-
replaceIfNull
public static short replaceIfNull(short value, short replacement) Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
value- value.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- value, if value is not null according to Deephaven convention, replacement otherwise.
-
replaceIfNull
public static short[] replaceIfNull(short[] values, short replacement) Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
values- the values.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- array containing value, if value is not null according to Deephaven convention, replacement otherwise.
-
replaceIfNull
Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
values- the values.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- array containing value, if value is not null according to Deephaven convention, replacement otherwise.
-
len
public static long len(short[] values) Returns the length of the input.- Parameters:
values- values.- Returns:
- length of the input or the Deephaven null constant for null inputs.
-
count
public static long count(short... values) Counts the number of non-null values.- Parameters:
values- values.- Returns:
- number of non-null values.
-
count
Counts the number of non-null values.- Parameters:
values- values.- Returns:
- number of non-null values.
-
last
Returns the last value from an array.- Parameters:
values- values.- Returns:
- last value from the array.
-
last
public static short last(short... values) Returns the last value from an array.- Parameters:
values- values.- Returns:
- last value from the array.
-
first
Returns the first value from an array.- Parameters:
values- values.- Returns:
- first value from the array.
-
first
public static short first(short... values) Returns the first value from an array.- Parameters:
values- values.- Returns:
- first value from the array.
-
nth
Returns the nth value from an array.- Parameters:
index- index of the value to return.values- values.- Returns:
- nth value from the array or null, if the index is outside of the array's index range.
-
nth
public static short nth(long index, short... values) Returns the nth value from an array.- Parameters:
index- index of the value to return.values- values.- Returns:
- nth value from the array or null, if the index is outside of the array's index range.
-
array
Converts a Deephaven vector to a primitive array that may be freely mutated by the caller.- Parameters:
values- Deephaven vector- Returns:
- primitive array, which may be freely mutated by the caller
-
vec
Converts a primitive array to a Deephaven vector.- Parameters:
values- primitive array- Returns:
- Deephaven vector.
-
inRange
public static boolean inRange(short testedValue, short lowInclusiveValue, short highInclusiveValue) Checks if a value is within a range.- Parameters:
testedValue- tested value.lowInclusiveValue- lower inclusive bound of the range.highInclusiveValue- upper inclusive bound of the range.- Returns:
- true if the tested value is within the range, and false if the tested value is not in the range or is null.
-
in
public static boolean in(short testedValues, short... possibleValues) Checks if a value is within a discrete set of possible values.- Parameters:
testedValues- tested value.possibleValues- possible values.- Returns:
- true if the tested value is contained in the possible values, and false otherwise.
-
countDistinct
public static long countDistinct(short... values) Counts the number of distinct elements in the array.- Parameters:
values- values.- Returns:
- number of distinct non-null values.
-
countDistinct
Counts the number of distinct elements in the array.- Parameters:
values- values.- Returns:
- number of distinct non-null values.
-
countDistinct
public static long countDistinct(short[] values, boolean countNull) Counts the number of distinct elements in the array.- Parameters:
values- values.countNull- true to count null values, and false to exclude null values.- Returns:
- number of distinct values.
-
countDistinct
Counts the number of distinct elements in the array.- Parameters:
values- values.countNull- true to count null values, and false to exclude null values.- Returns:
- number of distinct values.
-
distinct
public static short[] distinct(short... values) Returns an array containing only the distinct values from the input.- Parameters:
values- values.- Returns:
- unsorted array containing only distinct non-null items from arr.
-
distinct
Returns an array containing only the distinct values from the input.- Parameters:
values- values.- Returns:
- unsorted array containing only distinct non-null items from arr.
-
distinct
public static short[] distinct(short[] values, boolean includeNull) Returns an array containing only the distinct values from the input.- Parameters:
values- values.includeNull- true to include null values, and false to exclude null values.- Returns:
- array containing only distinct items from arr.
-
distinct
Returns an array containing only the distinct values from the input.- Parameters:
values- values.includeNull- true to include null values, and false to exclude null values.- Returns:
- array containing only distinct items from arr.
-
repeat
public static short[] repeat(short value, int size) Returns an array with a value repeated.- Parameters:
value- value.size- number of times to repeat the value.- Returns:
- array of repeated values. If
sizeis less than zero, an empty array is returned.
-
enlist
public static short[] enlist(short... values) Returns a list containing its arguments.- Parameters:
values- values.- Returns:
- list containing values.
-
concat
public static short[] concat(short[]... values) Returns the concatenation of multiple arrays into a single array.- Parameters:
values- values.- Returns:
- concatenation of multiple arrays into a single array.
-
concat
Returns the concatenation of multiple arrays into a single array.- Parameters:
values- values.- Returns:
- concatenation of multiple arrays into a single array.
-
reverse
public static short[] reverse(short... values) Returns an array with the values reversed.- Parameters:
values- values.- Returns:
- array with the values reversed.
-
reverse
Returns an array with the values reversed.- Parameters:
values- values.- Returns:
- array with the values reversed.
-
firstIndexOf
public static long firstIndexOf(short val, short... values) Returns the first index containing the value.- Parameters:
values- values.val- value to search for.- Returns:
- first index containing the value or null, if the value is not present.
-
firstIndexOf
Returns the first index containing the value.- Parameters:
values- values.val- value to search for.- Returns:
- first index containing the value or null, if the value is not present.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- trueCase value if condition is true, falseCase value if condition is false, or the Deephaven null constant if condition is null.
-
ifelse
public static short[] ifelse(ObjectVector<Boolean> condition, ShortVector trueCase, ShortVector falseCase) Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of short whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be the trueCase element if the condition element is true; the falseCase element if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if any of the inputs is null.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of short whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be the trueCase element if the condition element is true; the falseCase element if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if any of the inputs is null.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of short whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be trueCase if the condition element is true; falseCase if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if condition is null.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of short whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be trueCase if the condition element is true; falseCase if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if condition is null.
-
forwardFill
public static short[] forwardFill(short... values) Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists. Otherwise (if no such value exists), replaces those elements with Deephaven null.- Parameters:
values- values.- Returns:
- A copy of the specified array, with Deephaven null elements replaced as described above. If the specified array is null, returns null.
-
forwardFill
Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists. Otherwise (if no such value exists), replaces those elements with Deephaven null.- Parameters:
values- values.- Returns:
- A copy of the specified array, with Deephaven null elements replaced as described above. If the specified array is null, returns null.
-
isNull
public static boolean isNull(int value) Determines if a value is considered by the Deephaven convention to be null. In the Deephaven convention, every simple type T has a special distinguished value NULL_T which is used to represent the null value for that type. These values are enumerated in theQueryConstantsclass.- Parameters:
value- value.- Returns:
- true if the value is null according to the Deephaven convention, and false otherwise.
-
unbox
Unboxes an array of values.- Parameters:
values- values.- Returns:
- unboxed array of values.
-
replaceIfNull
public static int replaceIfNull(int value, int replacement) Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
value- value.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- value, if value is not null according to Deephaven convention, replacement otherwise.
-
replaceIfNull
public static int[] replaceIfNull(int[] values, int replacement) Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
values- the values.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- array containing value, if value is not null according to Deephaven convention, replacement otherwise.
-
replaceIfNull
Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
values- the values.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- array containing value, if value is not null according to Deephaven convention, replacement otherwise.
-
len
public static long len(int[] values) Returns the length of the input.- Parameters:
values- values.- Returns:
- length of the input or the Deephaven null constant for null inputs.
-
count
public static long count(int... values) Counts the number of non-null values.- Parameters:
values- values.- Returns:
- number of non-null values.
-
count
Counts the number of non-null values.- Parameters:
values- values.- Returns:
- number of non-null values.
-
last
Returns the last value from an array.- Parameters:
values- values.- Returns:
- last value from the array.
-
last
public static int last(int... values) Returns the last value from an array.- Parameters:
values- values.- Returns:
- last value from the array.
-
first
Returns the first value from an array.- Parameters:
values- values.- Returns:
- first value from the array.
-
first
public static int first(int... values) Returns the first value from an array.- Parameters:
values- values.- Returns:
- first value from the array.
-
nth
Returns the nth value from an array.- Parameters:
index- index of the value to return.values- values.- Returns:
- nth value from the array or null, if the index is outside of the array's index range.
-
nth
public static int nth(long index, int... values) Returns the nth value from an array.- Parameters:
index- index of the value to return.values- values.- Returns:
- nth value from the array or null, if the index is outside of the array's index range.
-
array
Converts a Deephaven vector to a primitive array that may be freely mutated by the caller.- Parameters:
values- Deephaven vector- Returns:
- primitive array, which may be freely mutated by the caller
-
vec
Converts a primitive array to a Deephaven vector.- Parameters:
values- primitive array- Returns:
- Deephaven vector.
-
inRange
public static boolean inRange(int testedValue, int lowInclusiveValue, int highInclusiveValue) Checks if a value is within a range.- Parameters:
testedValue- tested value.lowInclusiveValue- lower inclusive bound of the range.highInclusiveValue- upper inclusive bound of the range.- Returns:
- true if the tested value is within the range, and false if the tested value is not in the range or is null.
-
in
public static boolean in(int testedValues, int... possibleValues) Checks if a value is within a discrete set of possible values.- Parameters:
testedValues- tested value.possibleValues- possible values.- Returns:
- true if the tested value is contained in the possible values, and false otherwise.
-
countDistinct
public static long countDistinct(int... values) Counts the number of distinct elements in the array.- Parameters:
values- values.- Returns:
- number of distinct non-null values.
-
countDistinct
Counts the number of distinct elements in the array.- Parameters:
values- values.- Returns:
- number of distinct non-null values.
-
countDistinct
public static long countDistinct(int[] values, boolean countNull) Counts the number of distinct elements in the array.- Parameters:
values- values.countNull- true to count null values, and false to exclude null values.- Returns:
- number of distinct values.
-
countDistinct
Counts the number of distinct elements in the array.- Parameters:
values- values.countNull- true to count null values, and false to exclude null values.- Returns:
- number of distinct values.
-
distinct
public static int[] distinct(int... values) Returns an array containing only the distinct values from the input.- Parameters:
values- values.- Returns:
- unsorted array containing only distinct non-null items from arr.
-
distinct
Returns an array containing only the distinct values from the input.- Parameters:
values- values.- Returns:
- unsorted array containing only distinct non-null items from arr.
-
distinct
public static int[] distinct(int[] values, boolean includeNull) Returns an array containing only the distinct values from the input.- Parameters:
values- values.includeNull- true to include null values, and false to exclude null values.- Returns:
- array containing only distinct items from arr.
-
distinct
Returns an array containing only the distinct values from the input.- Parameters:
values- values.includeNull- true to include null values, and false to exclude null values.- Returns:
- array containing only distinct items from arr.
-
repeat
public static int[] repeat(int value, int size) Returns an array with a value repeated.- Parameters:
value- value.size- number of times to repeat the value.- Returns:
- array of repeated values. If
sizeis less than zero, an empty array is returned.
-
enlist
public static int[] enlist(int... values) Returns a list containing its arguments.- Parameters:
values- values.- Returns:
- list containing values.
-
concat
public static int[] concat(int[]... values) Returns the concatenation of multiple arrays into a single array.- Parameters:
values- values.- Returns:
- concatenation of multiple arrays into a single array.
-
concat
Returns the concatenation of multiple arrays into a single array.- Parameters:
values- values.- Returns:
- concatenation of multiple arrays into a single array.
-
reverse
public static int[] reverse(int... values) Returns an array with the values reversed.- Parameters:
values- values.- Returns:
- array with the values reversed.
-
reverse
Returns an array with the values reversed.- Parameters:
values- values.- Returns:
- array with the values reversed.
-
firstIndexOf
public static long firstIndexOf(int val, int... values) Returns the first index containing the value.- Parameters:
values- values.val- value to search for.- Returns:
- first index containing the value or null, if the value is not present.
-
firstIndexOf
Returns the first index containing the value.- Parameters:
values- values.val- value to search for.- Returns:
- first index containing the value or null, if the value is not present.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- trueCase value if condition is true, falseCase value if condition is false, or the Deephaven null constant if condition is null.
-
ifelse
public static int[] ifelse(ObjectVector<Boolean> condition, IntVector trueCase, IntVector falseCase) Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of int whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be the trueCase element if the condition element is true; the falseCase element if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if any of the inputs is null.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of int whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be the trueCase element if the condition element is true; the falseCase element if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if any of the inputs is null.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of int whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be trueCase if the condition element is true; falseCase if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if condition is null.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of int whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be trueCase if the condition element is true; falseCase if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if condition is null.
-
forwardFill
public static int[] forwardFill(int... values) Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists. Otherwise (if no such value exists), replaces those elements with Deephaven null.- Parameters:
values- values.- Returns:
- A copy of the specified array, with Deephaven null elements replaced as described above. If the specified array is null, returns null.
-
forwardFill
Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists. Otherwise (if no such value exists), replaces those elements with Deephaven null.- Parameters:
values- values.- Returns:
- A copy of the specified array, with Deephaven null elements replaced as described above. If the specified array is null, returns null.
-
isNull
public static boolean isNull(long value) Determines if a value is considered by the Deephaven convention to be null. In the Deephaven convention, every simple type T has a special distinguished value NULL_T which is used to represent the null value for that type. These values are enumerated in theQueryConstantsclass.- Parameters:
value- value.- Returns:
- true if the value is null according to the Deephaven convention, and false otherwise.
-
unbox
Unboxes an array of values.- Parameters:
values- values.- Returns:
- unboxed array of values.
-
replaceIfNull
public static long replaceIfNull(long value, long replacement) Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
value- value.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- value, if value is not null according to Deephaven convention, replacement otherwise.
-
replaceIfNull
public static long[] replaceIfNull(long[] values, long replacement) Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
values- the values.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- array containing value, if value is not null according to Deephaven convention, replacement otherwise.
-
replaceIfNull
Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
values- the values.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- array containing value, if value is not null according to Deephaven convention, replacement otherwise.
-
len
public static long len(long[] values) Returns the length of the input.- Parameters:
values- values.- Returns:
- length of the input or the Deephaven null constant for null inputs.
-
count
public static long count(long... values) Counts the number of non-null values.- Parameters:
values- values.- Returns:
- number of non-null values.
-
count
Counts the number of non-null values.- Parameters:
values- values.- Returns:
- number of non-null values.
-
last
Returns the last value from an array.- Parameters:
values- values.- Returns:
- last value from the array.
-
last
public static long last(long... values) Returns the last value from an array.- Parameters:
values- values.- Returns:
- last value from the array.
-
first
Returns the first value from an array.- Parameters:
values- values.- Returns:
- first value from the array.
-
first
public static long first(long... values) Returns the first value from an array.- Parameters:
values- values.- Returns:
- first value from the array.
-
nth
Returns the nth value from an array.- Parameters:
index- index of the value to return.values- values.- Returns:
- nth value from the array or null, if the index is outside of the array's index range.
-
nth
public static long nth(long index, long... values) Returns the nth value from an array.- Parameters:
index- index of the value to return.values- values.- Returns:
- nth value from the array or null, if the index is outside of the array's index range.
-
array
Converts a Deephaven vector to a primitive array that may be freely mutated by the caller.- Parameters:
values- Deephaven vector- Returns:
- primitive array, which may be freely mutated by the caller
-
vec
Converts a primitive array to a Deephaven vector.- Parameters:
values- primitive array- Returns:
- Deephaven vector.
-
inRange
public static boolean inRange(long testedValue, long lowInclusiveValue, long highInclusiveValue) Checks if a value is within a range.- Parameters:
testedValue- tested value.lowInclusiveValue- lower inclusive bound of the range.highInclusiveValue- upper inclusive bound of the range.- Returns:
- true if the tested value is within the range, and false if the tested value is not in the range or is null.
-
in
public static boolean in(long testedValues, long... possibleValues) Checks if a value is within a discrete set of possible values.- Parameters:
testedValues- tested value.possibleValues- possible values.- Returns:
- true if the tested value is contained in the possible values, and false otherwise.
-
countDistinct
public static long countDistinct(long... values) Counts the number of distinct elements in the array.- Parameters:
values- values.- Returns:
- number of distinct non-null values.
-
countDistinct
Counts the number of distinct elements in the array.- Parameters:
values- values.- Returns:
- number of distinct non-null values.
-
countDistinct
public static long countDistinct(long[] values, boolean countNull) Counts the number of distinct elements in the array.- Parameters:
values- values.countNull- true to count null values, and false to exclude null values.- Returns:
- number of distinct values.
-
countDistinct
Counts the number of distinct elements in the array.- Parameters:
values- values.countNull- true to count null values, and false to exclude null values.- Returns:
- number of distinct values.
-
distinct
public static long[] distinct(long... values) Returns an array containing only the distinct values from the input.- Parameters:
values- values.- Returns:
- unsorted array containing only distinct non-null items from arr.
-
distinct
Returns an array containing only the distinct values from the input.- Parameters:
values- values.- Returns:
- unsorted array containing only distinct non-null items from arr.
-
distinct
public static long[] distinct(long[] values, boolean includeNull) Returns an array containing only the distinct values from the input.- Parameters:
values- values.includeNull- true to include null values, and false to exclude null values.- Returns:
- array containing only distinct items from arr.
-
distinct
Returns an array containing only the distinct values from the input.- Parameters:
values- values.includeNull- true to include null values, and false to exclude null values.- Returns:
- array containing only distinct items from arr.
-
repeat
public static long[] repeat(long value, int size) Returns an array with a value repeated.- Parameters:
value- value.size- number of times to repeat the value.- Returns:
- array of repeated values. If
sizeis less than zero, an empty array is returned.
-
enlist
public static long[] enlist(long... values) Returns a list containing its arguments.- Parameters:
values- values.- Returns:
- list containing values.
-
concat
public static long[] concat(long[]... values) Returns the concatenation of multiple arrays into a single array.- Parameters:
values- values.- Returns:
- concatenation of multiple arrays into a single array.
-
concat
Returns the concatenation of multiple arrays into a single array.- Parameters:
values- values.- Returns:
- concatenation of multiple arrays into a single array.
-
reverse
public static long[] reverse(long... values) Returns an array with the values reversed.- Parameters:
values- values.- Returns:
- array with the values reversed.
-
reverse
Returns an array with the values reversed.- Parameters:
values- values.- Returns:
- array with the values reversed.
-
firstIndexOf
public static long firstIndexOf(long val, long... values) Returns the first index containing the value.- Parameters:
values- values.val- value to search for.- Returns:
- first index containing the value or null, if the value is not present.
-
firstIndexOf
Returns the first index containing the value.- Parameters:
values- values.val- value to search for.- Returns:
- first index containing the value or null, if the value is not present.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- trueCase value if condition is true, falseCase value if condition is false, or the Deephaven null constant if condition is null.
-
ifelse
public static long[] ifelse(ObjectVector<Boolean> condition, LongVector trueCase, LongVector falseCase) Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of long whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be the trueCase element if the condition element is true; the falseCase element if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if any of the inputs is null.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of long whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be the trueCase element if the condition element is true; the falseCase element if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if any of the inputs is null.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of long whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be trueCase if the condition element is true; falseCase if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if condition is null.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of long whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be trueCase if the condition element is true; falseCase if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if condition is null.
-
forwardFill
public static long[] forwardFill(long... values) Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists. Otherwise (if no such value exists), replaces those elements with Deephaven null.- Parameters:
values- values.- Returns:
- A copy of the specified array, with Deephaven null elements replaced as described above. If the specified array is null, returns null.
-
forwardFill
Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists. Otherwise (if no such value exists), replaces those elements with Deephaven null.- Parameters:
values- values.- Returns:
- A copy of the specified array, with Deephaven null elements replaced as described above. If the specified array is null, returns null.
-
isNull
public static boolean isNull(float value) Determines if a value is considered by the Deephaven convention to be null. In the Deephaven convention, every simple type T has a special distinguished value NULL_T which is used to represent the null value for that type. These values are enumerated in theQueryConstantsclass.- Parameters:
value- value.- Returns:
- true if the value is null according to the Deephaven convention, and false otherwise.
-
unbox
Unboxes an array of values.- Parameters:
values- values.- Returns:
- unboxed array of values.
-
replaceIfNull
public static float replaceIfNull(float value, float replacement) Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
value- value.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- value, if value is not null according to Deephaven convention, replacement otherwise.
-
replaceIfNull
public static float[] replaceIfNull(float[] values, float replacement) Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
values- the values.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- array containing value, if value is not null according to Deephaven convention, replacement otherwise.
-
replaceIfNull
Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
values- the values.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- array containing value, if value is not null according to Deephaven convention, replacement otherwise.
-
len
public static long len(float[] values) Returns the length of the input.- Parameters:
values- values.- Returns:
- length of the input or the Deephaven null constant for null inputs.
-
count
public static long count(float... values) Counts the number of non-null values.- Parameters:
values- values.- Returns:
- number of non-null values.
-
count
Counts the number of non-null values.- Parameters:
values- values.- Returns:
- number of non-null values.
-
last
Returns the last value from an array.- Parameters:
values- values.- Returns:
- last value from the array.
-
last
public static float last(float... values) Returns the last value from an array.- Parameters:
values- values.- Returns:
- last value from the array.
-
first
Returns the first value from an array.- Parameters:
values- values.- Returns:
- first value from the array.
-
first
public static float first(float... values) Returns the first value from an array.- Parameters:
values- values.- Returns:
- first value from the array.
-
nth
Returns the nth value from an array.- Parameters:
index- index of the value to return.values- values.- Returns:
- nth value from the array or null, if the index is outside of the array's index range.
-
nth
public static float nth(long index, float... values) Returns the nth value from an array.- Parameters:
index- index of the value to return.values- values.- Returns:
- nth value from the array or null, if the index is outside of the array's index range.
-
array
Converts a Deephaven vector to a primitive array that may be freely mutated by the caller.- Parameters:
values- Deephaven vector- Returns:
- primitive array, which may be freely mutated by the caller
-
vec
Converts a primitive array to a Deephaven vector.- Parameters:
values- primitive array- Returns:
- Deephaven vector.
-
inRange
public static boolean inRange(float testedValue, float lowInclusiveValue, float highInclusiveValue) Checks if a value is within a range.- Parameters:
testedValue- tested value.lowInclusiveValue- lower inclusive bound of the range.highInclusiveValue- upper inclusive bound of the range.- Returns:
- true if the tested value is within the range, and false if the tested value is not in the range or is null.
-
in
public static boolean in(float testedValues, float... possibleValues) Checks if a value is within a discrete set of possible values.- Parameters:
testedValues- tested value.possibleValues- possible values.- Returns:
- true if the tested value is contained in the possible values, and false otherwise.
-
countDistinct
public static long countDistinct(float... values) Counts the number of distinct elements in the array.- Parameters:
values- values.- Returns:
- number of distinct non-null values.
-
countDistinct
Counts the number of distinct elements in the array.- Parameters:
values- values.- Returns:
- number of distinct non-null values.
-
countDistinct
public static long countDistinct(float[] values, boolean countNull) Counts the number of distinct elements in the array.- Parameters:
values- values.countNull- true to count null values, and false to exclude null values.- Returns:
- number of distinct values.
-
countDistinct
Counts the number of distinct elements in the array.- Parameters:
values- values.countNull- true to count null values, and false to exclude null values.- Returns:
- number of distinct values.
-
distinct
public static float[] distinct(float... values) Returns an array containing only the distinct values from the input.- Parameters:
values- values.- Returns:
- unsorted array containing only distinct non-null items from arr.
-
distinct
Returns an array containing only the distinct values from the input.- Parameters:
values- values.- Returns:
- unsorted array containing only distinct non-null items from arr.
-
distinct
public static float[] distinct(float[] values, boolean includeNull) Returns an array containing only the distinct values from the input.- Parameters:
values- values.includeNull- true to include null values, and false to exclude null values.- Returns:
- array containing only distinct items from arr.
-
distinct
Returns an array containing only the distinct values from the input.- Parameters:
values- values.includeNull- true to include null values, and false to exclude null values.- Returns:
- array containing only distinct items from arr.
-
repeat
public static float[] repeat(float value, int size) Returns an array with a value repeated.- Parameters:
value- value.size- number of times to repeat the value.- Returns:
- array of repeated values. If
sizeis less than zero, an empty array is returned.
-
enlist
public static float[] enlist(float... values) Returns a list containing its arguments.- Parameters:
values- values.- Returns:
- list containing values.
-
concat
public static float[] concat(float[]... values) Returns the concatenation of multiple arrays into a single array.- Parameters:
values- values.- Returns:
- concatenation of multiple arrays into a single array.
-
concat
Returns the concatenation of multiple arrays into a single array.- Parameters:
values- values.- Returns:
- concatenation of multiple arrays into a single array.
-
reverse
public static float[] reverse(float... values) Returns an array with the values reversed.- Parameters:
values- values.- Returns:
- array with the values reversed.
-
reverse
Returns an array with the values reversed.- Parameters:
values- values.- Returns:
- array with the values reversed.
-
firstIndexOf
public static long firstIndexOf(float val, float... values) Returns the first index containing the value.- Parameters:
values- values.val- value to search for.- Returns:
- first index containing the value or null, if the value is not present.
-
firstIndexOf
Returns the first index containing the value.- Parameters:
values- values.val- value to search for.- Returns:
- first index containing the value or null, if the value is not present.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- trueCase value if condition is true, falseCase value if condition is false, or the Deephaven null constant if condition is null.
-
ifelse
public static float[] ifelse(ObjectVector<Boolean> condition, FloatVector trueCase, FloatVector falseCase) Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of float whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be the trueCase element if the condition element is true; the falseCase element if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if any of the inputs is null.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of float whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be the trueCase element if the condition element is true; the falseCase element if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if any of the inputs is null.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of float whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be trueCase if the condition element is true; falseCase if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if condition is null.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of float whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be trueCase if the condition element is true; falseCase if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if condition is null.
-
forwardFill
public static float[] forwardFill(float... values) Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists. Otherwise (if no such value exists), replaces those elements with Deephaven null.- Parameters:
values- values.- Returns:
- A copy of the specified array, with Deephaven null elements replaced as described above. If the specified array is null, returns null.
-
forwardFill
Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists. Otherwise (if no such value exists), replaces those elements with Deephaven null.- Parameters:
values- values.- Returns:
- A copy of the specified array, with Deephaven null elements replaced as described above. If the specified array is null, returns null.
-
isNull
public static boolean isNull(double value) Determines if a value is considered by the Deephaven convention to be null. In the Deephaven convention, every simple type T has a special distinguished value NULL_T which is used to represent the null value for that type. These values are enumerated in theQueryConstantsclass.- Parameters:
value- value.- Returns:
- true if the value is null according to the Deephaven convention, and false otherwise.
-
unbox
Unboxes an array of values.- Parameters:
values- values.- Returns:
- unboxed array of values.
-
replaceIfNull
public static double replaceIfNull(double value, double replacement) Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
value- value.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- value, if value is not null according to Deephaven convention, replacement otherwise.
-
replaceIfNull
public static double[] replaceIfNull(double[] values, double replacement) Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
values- the values.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- array containing value, if value is not null according to Deephaven convention, replacement otherwise.
-
replaceIfNull
Replaces values that are null according to Deephaven convention with a specified value.- Parameters:
values- the values.replacement- replacement to use when value is null according to Deephaven convention.- Returns:
- array containing value, if value is not null according to Deephaven convention, replacement otherwise.
-
len
public static long len(double[] values) Returns the length of the input.- Parameters:
values- values.- Returns:
- length of the input or the Deephaven null constant for null inputs.
-
count
public static long count(double... values) Counts the number of non-null values.- Parameters:
values- values.- Returns:
- number of non-null values.
-
count
Counts the number of non-null values.- Parameters:
values- values.- Returns:
- number of non-null values.
-
last
Returns the last value from an array.- Parameters:
values- values.- Returns:
- last value from the array.
-
last
public static double last(double... values) Returns the last value from an array.- Parameters:
values- values.- Returns:
- last value from the array.
-
first
Returns the first value from an array.- Parameters:
values- values.- Returns:
- first value from the array.
-
first
public static double first(double... values) Returns the first value from an array.- Parameters:
values- values.- Returns:
- first value from the array.
-
nth
Returns the nth value from an array.- Parameters:
index- index of the value to return.values- values.- Returns:
- nth value from the array or null, if the index is outside of the array's index range.
-
nth
public static double nth(long index, double... values) Returns the nth value from an array.- Parameters:
index- index of the value to return.values- values.- Returns:
- nth value from the array or null, if the index is outside of the array's index range.
-
array
Converts a Deephaven vector to a primitive array that may be freely mutated by the caller.- Parameters:
values- Deephaven vector- Returns:
- primitive array, which may be freely mutated by the caller
-
vec
Converts a primitive array to a Deephaven vector.- Parameters:
values- primitive array- Returns:
- Deephaven vector.
-
inRange
public static boolean inRange(double testedValue, double lowInclusiveValue, double highInclusiveValue) Checks if a value is within a range.- Parameters:
testedValue- tested value.lowInclusiveValue- lower inclusive bound of the range.highInclusiveValue- upper inclusive bound of the range.- Returns:
- true if the tested value is within the range, and false if the tested value is not in the range or is null.
-
in
public static boolean in(double testedValues, double... possibleValues) Checks if a value is within a discrete set of possible values.- Parameters:
testedValues- tested value.possibleValues- possible values.- Returns:
- true if the tested value is contained in the possible values, and false otherwise.
-
countDistinct
public static long countDistinct(double... values) Counts the number of distinct elements in the array.- Parameters:
values- values.- Returns:
- number of distinct non-null values.
-
countDistinct
Counts the number of distinct elements in the array.- Parameters:
values- values.- Returns:
- number of distinct non-null values.
-
countDistinct
public static long countDistinct(double[] values, boolean countNull) Counts the number of distinct elements in the array.- Parameters:
values- values.countNull- true to count null values, and false to exclude null values.- Returns:
- number of distinct values.
-
countDistinct
Counts the number of distinct elements in the array.- Parameters:
values- values.countNull- true to count null values, and false to exclude null values.- Returns:
- number of distinct values.
-
distinct
public static double[] distinct(double... values) Returns an array containing only the distinct values from the input.- Parameters:
values- values.- Returns:
- unsorted array containing only distinct non-null items from arr.
-
distinct
Returns an array containing only the distinct values from the input.- Parameters:
values- values.- Returns:
- unsorted array containing only distinct non-null items from arr.
-
distinct
public static double[] distinct(double[] values, boolean includeNull) Returns an array containing only the distinct values from the input.- Parameters:
values- values.includeNull- true to include null values, and false to exclude null values.- Returns:
- array containing only distinct items from arr.
-
distinct
Returns an array containing only the distinct values from the input.- Parameters:
values- values.includeNull- true to include null values, and false to exclude null values.- Returns:
- array containing only distinct items from arr.
-
repeat
public static double[] repeat(double value, int size) Returns an array with a value repeated.- Parameters:
value- value.size- number of times to repeat the value.- Returns:
- array of repeated values. If
sizeis less than zero, an empty array is returned.
-
enlist
public static double[] enlist(double... values) Returns a list containing its arguments.- Parameters:
values- values.- Returns:
- list containing values.
-
concat
public static double[] concat(double[]... values) Returns the concatenation of multiple arrays into a single array.- Parameters:
values- values.- Returns:
- concatenation of multiple arrays into a single array.
-
concat
Returns the concatenation of multiple arrays into a single array.- Parameters:
values- values.- Returns:
- concatenation of multiple arrays into a single array.
-
reverse
public static double[] reverse(double... values) Returns an array with the values reversed.- Parameters:
values- values.- Returns:
- array with the values reversed.
-
reverse
Returns an array with the values reversed.- Parameters:
values- values.- Returns:
- array with the values reversed.
-
firstIndexOf
public static long firstIndexOf(double val, double... values) Returns the first index containing the value.- Parameters:
values- values.val- value to search for.- Returns:
- first index containing the value or null, if the value is not present.
-
firstIndexOf
Returns the first index containing the value.- Parameters:
values- values.val- value to search for.- Returns:
- first index containing the value or null, if the value is not present.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- trueCase value if condition is true, falseCase value if condition is false, or the Deephaven null constant if condition is null.
-
ifelse
public static double[] ifelse(ObjectVector<Boolean> condition, DoubleVector trueCase, DoubleVector falseCase) Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of double whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be the trueCase element if the condition element is true; the falseCase element if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if any of the inputs is null.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of double whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be the trueCase element if the condition element is true; the falseCase element if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if any of the inputs is null.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of double whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be trueCase if the condition element is true; falseCase if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if condition is null.
-
ifelse
Returns elements from either trueCase or falseCase, depending on condition.- Parameters:
condition- a boolean value used to select output values.trueCase- value returned when condition is true.falseCase- value returned when condition is false.- Returns:
- An array of double whose values are determined by the corresponding elements of condition, trueCase, and falseCase. The result element will be trueCase if the condition element is true; falseCase if the condition element is false; or the Deephaven null constant if the condition element is null. Returns null if condition is null.
-
forwardFill
public static double[] forwardFill(double... values) Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists. Otherwise (if no such value exists), replaces those elements with Deephaven null.- Parameters:
values- values.- Returns:
- A copy of the specified array, with Deephaven null elements replaced as described above. If the specified array is null, returns null.
-
forwardFill
Copies the specified array, replacing elements that represent null in the Deephaven convention by the most recently encountered non-null value if one exists. Otherwise (if no such value exists), replaces those elements with Deephaven null.- Parameters:
values- values.- Returns:
- A copy of the specified array, with Deephaven null elements replaced as described above. If the specified array is null, returns null.
-