Interface ValueVector
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractVector, BooleanVector, ByteVector, CharVector, DoubleVector, FloatVector, IntVector, LongVector, NullableBooleanVector, NullableByteVector, NullableCharVector, NullableDoubleVector, NullableFloatVector, NullableIntVector, NullableLongVector, NullablePrimitiveVector, NullableShortVector, NumberVector, ObjectVector, PrimitiveVector, ShortVector, StringVector
ValueVector interface is an abstraction that is used to store a sequence
of values having the same type in an individual column of data frame.
The implementation should support random access and sequential stream
operations.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleananyNull()Returns true if there are any null/missing values in this vector.default Objectapply(int i) Returns the value at position i, which may be null.default ValueVectorapply(int... indices) Returns a new vector with selected entries.default DoubleStreamReturns a DoubleStream consisting of the elements of this vector, converted to double.default DataTypedtype()Returns the data type of elements.default boolean[]Returns the result of equality comparison.field()Returns the struct field of the vector.default <T extends Comparable<T>>
boolean[]ge(T other) Returns the result of greater-than or equal comparison.get(int i) Returns the value at position i, which may be null.default ValueVectorget(int... indices) Returns a new vector with selected entries.Returns a new vector with selected entries.booleangetBoolean(int i) Returns the boolean value at position i.bytegetByte(int i) Returns the byte value at position i.chargetChar(int i) Returns the character value at position i.doublegetDouble(int i) Returns the double value at position i.floatgetFloat(int i) Returns the float value at position i.intgetInt(int i) Returns the integer value at position i.longgetLong(int i) Returns the long value at position i.intReturns the number of null/missing values in this vector.default StringgetScale(int i) Returns the value at position i of NominalScale or OrdinalScale.shortgetShort(int i) Returns the short value at position i.default StringgetString(int i) Returns the string representation of the value at position i.default <T extends Comparable<T>>
boolean[]gt(T other) Returns the result of greater-than comparison.default IntStreamReturns an IntStream consisting of the elements of this vector, converted to integer.default boolean[]Returns whether each element is contained in values.default boolean[]isNull()Returns whether each element is null/missing.booleanReturns true if the values of vector may be null.booleanisNullAt(int i) Returns true if the value at the given index is null/missing.default <T extends Comparable<T>>
boolean[]le(T other) Returns the result of less-than or equal comparison.default LongStreamReturns a LongStream consisting of the elements of this vector, converted to long.default <T extends Comparable<T>>
boolean[]lt(T other) Returns the result of less-than comparison.default Measuremeasure()Returns the (optional) level of measurements.default Stringname()Returns the name of vector.default boolean[]Returns the result of non-equality comparison.static ValueVectorCreates a nominal value vector.static ValueVectorCreates a nominal value vector.static BooleanVectorCreates a boolean vector.static ByteVectorCreates a byte vector.static CharVectorCreates a char vector.static DoubleVectorCreates a named double vector.static FloatVectorCreates a float vector.static IntVectorCreates an integer vector.static LongVectorCreates a long vector.static ShortVectorCreates a short integer vector.static StringVectorCreates a string vector.static NumberVector<BigDecimal> of(String name, BigDecimal... vector) Creates a decimal vector.static ObjectVector<Timestamp> Creates a timestamp vector.static ObjectVector<Instant> Creates an instant vector.static ObjectVector<LocalDate> Creates a date vector.static ObjectVector<LocalDateTime> of(String name, LocalDateTime... vector) Creates a datetime vector.static ObjectVector<LocalTime> Creates a time vector.static ObjectVector<OffsetTime> of(String name, OffsetTime... vector) Creates a time vector.static ObjectVector<ZonedDateTime> of(String name, ZonedDateTime... vector) Creates a datetime vector.static NullableBooleanVectorofNullable(String name, Boolean... vector) Creates a nullable boolean vector.static NullableByteVectorofNullable(String name, Byte... vector) Creates a nullable byte vector.static NullableCharVectorofNullable(String name, Character... vector) Creates a nullable char vector.static NullableDoubleVectorofNullable(String name, Double... vector) Creates a nullable double vector.static NullableFloatVectorofNullable(String name, Float... vector) Creates a nullable float vector.static NullableIntVectorofNullable(String name, Integer... vector) Creates a nullable integer vector.static NullableLongVectorofNullable(String name, Long... vector) Creates a nullable long integer vector.static NullableShortVectorofNullable(String name, Short... vector) Creates a nullable short integer vector.static ValueVectorCreates a nominal value vector.static ValueVectorCreates a nominal value vector.voidSets the value at position i.intsize()Returns the number of elements in the vector.default ValueVectorslice(int start, int end) Returns the slice index for [start, end) with step 1.default ValueVectorslice(int start, int end, int step) Returns the slice index for [start, end) with step 1.default Stream<?> stream()Returns a stream consisting of the elements of this vector.default double[]Returns a double array of this vector.default int[]Returns an int array of this vector.default long[]Returns a long array of this vector.default String[]Returns a string array of this vector.default String[]toStringArray(String[] a) Copies the vector value as string to the given array.default voidUpdates the value at position i.Returns the vector with the new name.
-
Method Details
-
field
-
size
int size()Returns the number of elements in the vector.- Returns:
- the number of elements in the vector.
-
withName
Returns the vector with the new name.- Parameters:
name- the new name.- Returns:
- the vector with the new name.
-
name
-
dtype
-
measure
Returns the (optional) level of measurements. Only valid for number types.- Returns:
- the (optional) level of measurements.
-
isNullable
boolean isNullable()Returns true if the values of vector may be null.- Returns:
- true if the values of vector may be null.
-
isNullAt
boolean isNullAt(int i) Returns true if the value at the given index is null/missing.- Parameters:
i- the index.- Returns:
- true if the value at the given index is null/missing.
-
getNullCount
int getNullCount()Returns the number of null/missing values in this vector.- Returns:
- the number of null/missing values in this vector.
-
eq
Returns the result of equality comparison.- Parameters:
other- the reference object with which to compare.- Returns:
- the result of equality comparison.
-
ne
Returns the result of non-equality comparison.- Parameters:
other- the reference object with which to compare.- Returns:
- the result of non-equality comparison.
-
lt
Returns the result of less-than comparison.- Type Parameters:
T- the type of the vector elements.- Parameters:
other- the reference object with which to compare.- Returns:
- the result of less-than comparison.
-
le
Returns the result of less-than or equal comparison.- Type Parameters:
T- the type of the vector elements.- Parameters:
other- the reference object with which to compare.- Returns:
- the result of less-than or equal comparison.
-
gt
Returns the result of greater-than comparison.- Type Parameters:
T- the type of the vector elements.- Parameters:
other- the reference object with which to compare.- Returns:
- the result of greater-than comparison.
-
ge
Returns the result of greater-than or equal comparison.- Type Parameters:
T- the type of the vector elements.- Parameters:
other- the reference object with which to compare.- Returns:
- the result of greater-than or equal comparison.
-
anyNull
default boolean anyNull()Returns true if there are any null/missing values in this vector.- Returns:
- true if there are any null/missing values in this vector.
-
isNull
default boolean[] isNull()Returns whether each element is null/missing.- Returns:
- whether each element is null/missing.
-
isin
Returns whether each element is contained in values.- Parameters:
values- the set of values.- Returns:
- whether each element is contained in values.
-
stream
Returns a stream consisting of the elements of this vector.- Returns:
- a stream consisting of the elements of this vector.
-
intStream
Returns an IntStream consisting of the elements of this vector, converted to integer.- Returns:
- an IntStream consisting of the elements of this vector.
-
longStream
Returns a LongStream consisting of the elements of this vector, converted to long.- Returns:
- a LongStream consisting of the elements of this vector.
-
doubleStream
Returns a DoubleStream consisting of the elements of this vector, converted to double.- Returns:
- a DoubleStream consisting of the elements of this vector.
-
toIntArray
default int[] toIntArray()Returns an int array of this vector.- Returns:
- an int array.
-
toLongArray
default long[] toLongArray()Returns a long array of this vector.- Returns:
- a long array.
-
toDoubleArray
default double[] toDoubleArray()Returns a double array of this vector.- Returns:
- a double array.
-
toStringArray
-
toStringArray
-
get
Returns the value at position i, which may be null.- Parameters:
i- the index.- Returns:
- the value.
-
apply
-
set
Sets the value at position i.- Parameters:
i- the index.value- the new value.
-
update
-
get
Returns a new vector with selected entries.- Parameters:
index- the index of selected entries.- Returns:
- the new vector of selected entries.
-
get
Returns a new vector with selected entries.- Parameters:
indices- the index of selected entries.- Returns:
- the new vector of selected entries.
-
apply
Returns a new vector with selected entries. This is an alias togetfor Scala's convenience.- Parameters:
indices- the index of selected entries.- Returns:
- the new vector of selected entries.
-
slice
Returns the slice index for [start, end) with step 1.- Parameters:
start- the start index.end- the end index.- Returns:
- the slice.
-
slice
Returns the slice index for [start, end) with step 1.- Parameters:
start- the start index.end- the end index.step- the incremental step.- Returns:
- the slice.
-
getString
Returns the string representation of the value at position i.- Parameters:
i- the index.- Returns:
- string representation.
-
getScale
Returns the value at position i of NominalScale or OrdinalScale.- Parameters:
i- the index.- Returns:
- the value scale.
- Throws:
ClassCastException- when the data is not nominal or ordinal.
-
getBoolean
boolean getBoolean(int i) Returns the boolean value at position i.- Parameters:
i- the index.- Returns:
- the value.
-
getChar
char getChar(int i) Returns the character value at position i.- Parameters:
i- the index.- Returns:
- the value.
-
getByte
byte getByte(int i) Returns the byte value at position i.- Parameters:
i- the index.- Returns:
- the value.
-
getShort
short getShort(int i) Returns the short value at position i.- Parameters:
i- the index.- Returns:
- the value.
-
getInt
int getInt(int i) Returns the integer value at position i.- Parameters:
i- the index.- Returns:
- the value.
-
getLong
long getLong(int i) Returns the long value at position i.- Parameters:
i- the index.- Returns:
- the value.
-
getFloat
float getFloat(int i) Returns the float value at position i.- Parameters:
i- the index.- Returns:
- the value.
-
getDouble
double getDouble(int i) Returns the double value at position i.- Parameters:
i- the index.- Returns:
- the value.
-
of
Creates a boolean vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
ofNullable
Creates a nullable boolean vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
of
Creates a char vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
ofNullable
Creates a nullable char vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
of
Creates a byte vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
ofNullable
Creates a nullable byte vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
of
Creates a short integer vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
ofNullable
Creates a nullable short integer vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
of
-
ofNullable
Creates a nullable integer vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
of
Creates a long vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
ofNullable
Creates a nullable long integer vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
of
Creates a float vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
ofNullable
Creates a nullable float vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
of
Creates a named double vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
ofNullable
Creates a nullable double vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
of
Creates a string vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
of
Creates a decimal vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
of
Creates a timestamp vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
of
Creates an instant vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
of
Creates a datetime vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
of
Creates a datetime vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
of
Creates a date vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
of
Creates a time vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
of
Creates a time vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
nominal
Creates a nominal value vector.- Parameters:
name- the name of vector.vector- the enum data of vector.- Returns:
- the vector.
-
nominal
Creates a nominal value vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-
ordinal
Creates a nominal value vector.- Parameters:
name- the name of vector.vector- the enum data of vector.- Returns:
- the vector.
-
ordinal
Creates a nominal value vector.- Parameters:
name- the name of vector.vector- the data of vector.- Returns:
- the vector.
-