fi.pelam.csv

util

package util

This package contains some classes used by this CSV library, but which are not directly related to processing CSV data.

Contents of this package should not be used outside of this library.

Source
package.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. util
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. sealed trait Pipeline[S <: StageResult[S]] extends AnyRef

    A monad abstraction that can be used to build up a chain of transformations of state.

    A monad abstraction that can be used to build up a chain of transformations of state. An input state can then be passed through the pipeline with the run method.

    The state is queried for success via the trait StageResult.

    If the state does not report as success after executing a stage, the rest of the pipeline is bypassed.

    Code example

    case class State(override val success: Boolean = true, value: Int = 0) extends SuccessState
    
    val pipeline = for (
      _ <- Pipeline.Stage((a: State) => a.copy(value = a.value + 1));
      _ <- Pipeline.Stage((a: State) => a.copy(value = a.value + 10));
      finalState <- Pipeline.Stage((a: State) => a.copy(value = a.value + 100))
    ) yield finalState
    
    println(pipeline.run(State()))
    // Will print State(true,111)
    S

    The type of the state to be threaded through pipeline stages.

  2. final case class SortedBiMap[K, V](map: SortedMap[K, V])(implicit keyOrdering: Ordering[K]) extends SortedMap[K, V] with Product with Serializable

    Bidirectional map supporting multiple values for a single key.

    Bidirectional map supporting multiple values for a single key.

    This class is used in Table to map between rows and columns and their types.

    The iteration order is determined by the keyOrdering implicit.

    The fact that the map is ordered by keys is useful in Table because then the columns and rows will be ordered naturally in both the forward and reverse maps.

    The ordering of values in reverse map is defined by the key order taking into account the first key on which each value occurs.

    Note

    This class uses Scala's SortedMap under the hood.

  3. trait StageResult[T <: StageResult[T]] extends AnyRef

    A trait that captures whether some state during some computation is considered successful.

    A trait that captures whether some state during some computation is considered successful.

    This is used by Pipeline.

Value Members

  1. object FormatterUtil

  2. object Pipeline

  3. object SortedBiMap extends Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped