def init()

in core/src/main/scala/com/spotify/featran/FeatureBuilder.scala [77:114]


  def init(dimension: Int): Unit

  /**
   * Prepare the builder for the next transformer. This should be called only once per transformer
   * per input row.
   * @param transformer
   *   the next transformer in line
   */
  def prepare(transformer: Transformer[_, _, _]): Unit = ()

  /** Gather builder result for a result. This should be called only once per input row. */
  def result: T

  /**
   * Add a single feature value. The total number of values added and skipped should equal to
   * dimension in [[init]].
   */
  def add(name: String, value: Double): Unit

  /**
   * Skip a single feature value. The total number of values added and skipped should equal to
   * dimension in [[init]].
   */
  def skip(): Unit

  /**
   * Add multiple feature values. The total number of values added and skipped should equal to
   * dimension in [[init]].
   */
  def add[M[_]](names: Iterable[String], values: M[Double])(implicit
    ev: M[Double] => Seq[Double]
  ): Unit = {
    val i = names.iterator
    val j = ev(values).iterator
    while (i.hasNext && j.hasNext) {
      add(i.next(), j.next())
    }
  }