Interface StringVector

All Superinterfaces:
BaseVector<String,String,Stream<String>>, Serializable, Vector<String>

public interface StringVector extends Vector<String>
An immutable string vector.
  • Method Details

    • get

      StringVector get(int... index)
      Description copied from interface: BaseVector
      Returns a new vector with selected entries.
      Specified by:
      get in interface BaseVector<String,String,Stream<String>>
      Specified by:
      get in interface Vector<String>
      Parameters:
      index - the index of selected entries.
      Returns:
      the new vector of selected entries.
    • getBoolean

      default boolean getBoolean(int i)
      Description copied from interface: BaseVector
      Returns the boolean value at position i.
      Specified by:
      getBoolean in interface BaseVector<String,String,Stream<String>>
      Specified by:
      getBoolean in interface Vector<String>
      Parameters:
      i - the index.
      Returns:
      the value.
    • getChar

      default char getChar(int i)
      Description copied from interface: BaseVector
      Returns the character value at position i.
      Specified by:
      getChar in interface BaseVector<String,String,Stream<String>>
      Specified by:
      getChar in interface Vector<String>
      Parameters:
      i - the index.
      Returns:
      the value.
    • getByte

      default byte getByte(int i)
      Description copied from interface: BaseVector
      Returns the byte value at position i.
      Specified by:
      getByte in interface BaseVector<String,String,Stream<String>>
      Specified by:
      getByte in interface Vector<String>
      Parameters:
      i - the index.
      Returns:
      the value.
    • getShort

      default short getShort(int i)
      Description copied from interface: BaseVector
      Returns the short value at position i.
      Specified by:
      getShort in interface BaseVector<String,String,Stream<String>>
      Specified by:
      getShort in interface Vector<String>
      Parameters:
      i - the index.
      Returns:
      the value.
    • getInt

      default int getInt(int i)
      Description copied from interface: BaseVector
      Returns the integer value at position i.
      Specified by:
      getInt in interface BaseVector<String,String,Stream<String>>
      Specified by:
      getInt in interface Vector<String>
      Parameters:
      i - the index.
      Returns:
      the value.
    • getLong

      default long getLong(int i)
      Description copied from interface: BaseVector
      Returns the long value at position i.
      Specified by:
      getLong in interface BaseVector<String,String,Stream<String>>
      Specified by:
      getLong in interface Vector<String>
      Parameters:
      i - the index.
      Returns:
      the value.
    • getFloat

      default float getFloat(int i)
      Description copied from interface: BaseVector
      Returns the float value at position i.
      Specified by:
      getFloat in interface BaseVector<String,String,Stream<String>>
      Specified by:
      getFloat in interface Vector<String>
      Parameters:
      i - the index.
      Returns:
      the value.
    • getDouble

      default double getDouble(int i)
      Description copied from interface: BaseVector
      Returns the double value at position i.
      Specified by:
      getDouble in interface BaseVector<String,String,Stream<String>>
      Specified by:
      getDouble in interface Vector<String>
      Parameters:
      i - the index.
      Returns:
      the value.
    • toDate

      default Vector<LocalDate> toDate(String pattern)
      Returns a vector of LocalDate. This method assumes that this is a string vector and uses the given date format pattern to parse strings.
      Parameters:
      pattern - the datetime formatter pattern.
      Returns:
      the date vector.
    • toDate

      Returns a vector of LocalDate. This method assumes that this is a string vector and uses the given date format pattern to parse strings.
      Parameters:
      format - the datetime formatter.
      Returns:
      the date vector.
    • toTime

      default Vector<LocalTime> toTime(String pattern)
      Returns a vector of LocalTime. This method assumes that this is a string vector and uses the given time format pattern to parse strings.
      Parameters:
      pattern - the datetime formatter pattern.
      Returns:
      the time vector.
    • toTime

      Returns a vector of LocalDate. This method assumes that this is a string vector and uses the given time format pattern to parse strings.
      Parameters:
      format - the datetime formatter.
      Returns:
      the time vector.
    • toDateTime

      default Vector<LocalDateTime> toDateTime(String pattern)
      Returns a vector of LocalDateTime. This method assumes that this is a string vector and uses the given date time format pattern to parse strings.
      Parameters:
      pattern - the datetime formatter pattern.
      Returns:
      the datetime vector.
    • toDateTime

      Vector<LocalDateTime> toDateTime(DateTimeFormatter format)
      Returns a vector of LocalDateTime. This method assumes that this is a string vector and uses the given date time format pattern to parse strings.
      Parameters:
      format - the datetime formatter.
      Returns:
      the datetime vector.
    • nominal

      NominalScale nominal()
      Returns a nominal scale of measure based on distinct values in the vector.
      Returns:
      the nominal scale.
    • factorize

      BaseVector factorize(CategoricalMeasure scale)
      Converts strings to discrete measured values. Depending on how many levels in the nominal scale, the type of returned vector may be byte, short or integer. The missing values/nulls will be converted to -1.
      Parameters:
      scale - the categorical measure.
      Returns:
      the factorized vector.
    • toString

      default String toString(int n)
      Returns the string representation of vector.
      Specified by:
      toString in interface Vector<String>
      Parameters:
      n - the number of elements to show.
      Returns:
      the string representation of vector.
    • of

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

      static StringVector of(StructField field, String... vector)
      Creates a named string vector.
      Parameters:
      field - the struct field of vector.
      vector - the data of vector.
      Returns:
      the vector.