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.
    • 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.