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

public interface ValueVector extends Serializable
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 Details

    • field

      StructField field()
      Returns the struct field of the vector.
      Returns:
      the struct field.
    • size

      int size()
      Returns the number of elements in the vector.
      Returns:
      the number of elements in the vector.
    • withName

      ValueVector withName(String name)
      Returns the vector with the new name.
      Parameters:
      name - the new name.
      Returns:
      the vector with the new name.
    • name

      default String name()
      Returns the name of vector.
      Returns:
      the name of vector.
    • dtype

      default DataType dtype()
      Returns the data type of elements.
      Returns:
      the data type of elements.
    • measure

      default Measure 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

      default boolean[] eq(Object other)
      Returns the result of equality comparison.
      Parameters:
      other - the reference object with which to compare.
      Returns:
      the result of equality comparison.
    • ne

      default boolean[] ne(Object other)
      Returns the result of non-equality comparison.
      Parameters:
      other - the reference object with which to compare.
      Returns:
      the result of non-equality comparison.
    • lt

      default <T extends Comparable<T>> boolean[] lt(T other)
      Returns the result of less-than comparison.
      Parameters:
      other - the reference object with which to compare.
      Returns:
      the result of less-than comparison.
    • le

      default <T extends Comparable<T>> boolean[] le(T other)
      Returns the result of less-than or equal comparison.
      Parameters:
      other - the reference object with which to compare.
      Returns:
      the result of less-than or equal comparison.
    • gt

      default <T extends Comparable<T>> boolean[] gt(T other)
      Returns the result of greater-than comparison.
      Parameters:
      other - the reference object with which to compare.
      Returns:
      the result of greater-than comparison.
    • ge

      default <T extends Comparable<T>> boolean[] ge(T other)
      Returns the result of greater-than or equal comparison.
      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

      default boolean[] isin(String... values)
      Returns whether each element is contained in values.
      Parameters:
      values - the set of values.
      Returns:
      whether each element is contained in values.
    • stream

      default Stream<?> stream()
      Returns a stream consisting of the elements of this vector.
      Returns:
      a stream consisting of the elements of this vector.
    • intStream

      default IntStream 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

      default LongStream 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

      default DoubleStream 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

      default String[] toStringArray()
      Returns a string array of this vector.
      Returns:
      the string array.
    • toStringArray

      default String[] toStringArray(String[] a)
      Copies the vector value as string to the given array.
      Parameters:
      a - the array to copy into.
      Returns:
      the input array a.
    • get

      Object get(int i)
      Returns the value at position i, which may be null.
      Parameters:
      i - the index.
      Returns:
      the value.
    • apply

      default Object apply(int i)
      Returns the value at position i, which may be null. This is an alias to get for Scala's convenience.
      Parameters:
      i - the index.
      Returns:
      the value.
    • set

      void set(int i, Object value)
      Sets the value at position i.
      Parameters:
      i - the index.
      value - the new value.
    • update

      default void update(int i, Object value)
      Updates the value at position i. This is an alias to set for Scala's convenience.
      Parameters:
      i - the index.
      value - the new value.
    • get

      ValueVector get(Index index)
      Returns a new vector with selected entries.
      Parameters:
      index - the index of selected entries.
      Returns:
      the new vector of selected entries.
    • get

      default ValueVector get(int... indices)
      Returns a new vector with selected entries.
      Parameters:
      indices - the index of selected entries.
      Returns:
      the new vector of selected entries.
    • apply

      default ValueVector apply(int... indices)
      Returns a new vector with selected entries. This is an alias to get for Scala's convenience.
      Parameters:
      indices - the index of selected entries.
      Returns:
      the new vector of selected entries.
    • slice

      default ValueVector slice(int start, int end)
      Returns the slice index for [start, end) with step 1.
      Parameters:
      start - the start index.
      end - the end index.
      Returns:
      the slice.
    • slice

      default ValueVector slice(int start, int end, int step)
      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

      default String getString(int i)
      Returns the string representation of the value at position i.
      Parameters:
      i - the index.
      Returns:
      string representation.
    • getScale

      default String getScale(int i)
      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

      static BooleanVector of(String name, boolean... vector)
      Creates a boolean vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • ofNullable

      static NullableBooleanVector ofNullable(String name, Boolean... vector)
      Creates a nullable boolean vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • of

      static CharVector of(String name, char... vector)
      Creates a char vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • ofNullable

      static NullableCharVector ofNullable(String name, Character... vector)
      Creates a nullable char vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • of

      static ByteVector of(String name, byte... vector)
      Creates a byte vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • ofNullable

      static NullableByteVector ofNullable(String name, Byte... vector)
      Creates a nullable byte vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • of

      static ShortVector of(String name, short... vector)
      Creates a short integer vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • ofNullable

      static NullableShortVector ofNullable(String name, Short... vector)
      Creates a nullable short integer vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • of

      static IntVector of(String name, int... vector)
      Creates an integer vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • ofNullable

      static NullableIntVector ofNullable(String name, Integer... vector)
      Creates a nullable integer vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • of

      static LongVector of(String name, long... vector)
      Creates a long vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • ofNullable

      static NullableLongVector ofNullable(String name, Long... vector)
      Creates a nullable long integer vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • of

      static FloatVector of(String name, float... vector)
      Creates a float vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • ofNullable

      static NullableFloatVector ofNullable(String name, Float... vector)
      Creates a nullable float vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • of

      static DoubleVector of(String name, double... vector)
      Creates a named double vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • ofNullable

      static NullableDoubleVector ofNullable(String name, Double... vector)
      Creates a nullable double vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • of

      static StringVector of(String name, String... vector)
      Creates a string vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • of

      static NumberVector<BigDecimal> of(String name, BigDecimal... vector)
      Creates a decimal vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • of

      static ObjectVector<Timestamp> of(String name, Timestamp... vector)
      Creates a timestamp vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • of

      static ObjectVector<Instant> of(String name, Instant... vector)
      Creates an instant vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • of

      static ObjectVector<LocalDateTime> of(String name, LocalDateTime... vector)
      Creates a datetime vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • of

      static ObjectVector<ZonedDateTime> of(String name, ZonedDateTime... vector)
      Creates a datetime vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • of

      static ObjectVector<LocalDate> of(String name, LocalDate... vector)
      Creates a date vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • of

      static ObjectVector<LocalTime> of(String name, LocalTime... vector)
      Creates a time vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • of

      static ObjectVector<OffsetTime> of(String name, OffsetTime... vector)
      Creates a time vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • nominal

      static ValueVector nominal(String name, Enum<?>... vector)
      Creates a nominal value vector.
      Parameters:
      name - the name of vector.
      vector - the enum data of vector.
      Returns:
      the vector.
    • nominal

      static ValueVector nominal(String name, String... vector)
      Creates a nominal value vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.
    • ordinal

      static ValueVector ordinal(String name, Enum<?>... vector)
      Creates a nominal value vector.
      Parameters:
      name - the name of vector.
      vector - the enum data of vector.
      Returns:
      the vector.
    • ordinal

      static ValueVector ordinal(String name, String... vector)
      Creates a nominal value vector.
      Parameters:
      name - the name of vector.
      vector - the data of vector.
      Returns:
      the vector.