c

com.phasmidsoftware.tableparser.core.parse

IndexedInputToRowsTransformer

class IndexedInputToRowsTransformer[Input, Row] extends InputTransformer[Input, Row]

A transformer class designed to map and process inputs to rows while handling indexed inputs.

This class extends InputTransformer and provides functionality to apply a transformation defined by a function f to indexed inputs ((Input, Int)), processing the resulting Try[Row] instances to either extract valid Row results or handle errors using logging.

Input

The type of input elements to be processed. Must have an implicit Joinable[Input] defined.

Row

The type of rows produced after transformation.

Linear Supertypes
InputTransformer[Input, Row], InputPreprocessor[Input, Row], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. IndexedInputToRowsTransformer
  2. InputTransformer
  3. InputPreprocessor
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new IndexedInputToRowsTransformer(f: ((Input, Int)) => Try[Row], multiline: Boolean)(implicit arg0: Joinable[Input])

    f

    A function that takes an (Input, Int) tuple and maps it to a Try[Row], representing the transformation logic from input to row with error handling.

    multiline

    A boolean flag indicating whether the transformation operates in a multiline mode.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. def mapTsToRows(xs: Iterator[Input])(multiline: Boolean)(g: ((Input, Int)) => Try[Row])(implicit ev: Joinable[(Input, Int)]): Iterator[Try[Row]]

    Processes an input iterator of type Input and maps its elements into rows of type Row while handling potential errors using a specified transformation function.

    Processes an input iterator of type Input and maps its elements into rows of type Row while handling potential errors using a specified transformation function. The function can operate in two modes: - Multiline mode: input data can span multiple lines and will be joined using the provided Joinable type class. - Single-line mode: each input element is processed independently.

    xs

    The input iterator containing elements of type Input.

    multiline

    A Boolean flag indicating whether to process input in multiline mode.

    • true: Enables multiline processing using the provided Joinable type class.
    • false: Processes each input independently.
    g

    A transformation function that takes a tuple (Input, Int), representing an input element and its index, and returns a Try[Row]. The function should encapsulate the logic for mapping input to a row, including error handling.

    ev

    An implicit instance of the Joinable[(Input, Int)] type class, which handles joining and validating input tuples during multiline mode.

    returns

    An iterator of Try[Row], where each element represents either a successfully processed row or a failure.

    • In multiline mode, elements may span across multiple lines, joined using the logic provided by the Joinable type class.
    • In single-line mode, each input element is processed individually.
    Definition Classes
    InputPreprocessor
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. def processInput(xs: Iterator[Input]): Iterator[Row]

    Processes an iterator of input elements, transforming them into an iterator of output rows.

    Processes an iterator of input elements, transforming them into an iterator of output rows. This method applies a two-step transformation: first, it maps the input elements into Try[Row] instances using the mapTsToRows method, then it processes these Try[Row] instances with processTriedRows to produce valid rows or handle errors.

    xs

    An Iterator of input elements of type Input, representing the data to be transformed.

    returns

    An Iterator of output rows of type Row, resulting from the transformation process.

    Definition Classes
    IndexedInputToRowsTransformer → InputTransformer
  16. def processTriedRows(rys: Iterator[Try[Row]]): Iterator[Row]

    Processes an iterator of Try[Row] instances, filtering out any failures and retaining only successful results.

    Processes an iterator of Try[Row] instances, filtering out any failures and retaining only successful results. For each Failure encountered, the exception is logged using the logException method. The successful Row objects are then extracted and returned as an iterator.

    rys

    An Iterator of Try[Row] instances to be processed, where each element represents a possible row or an error.

    returns

    An Iterator of Row objects, containing only the successful results from the input.

    Definition Classes
    IndexedInputToRowsTransformer → InputTransformer
  17. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  18. def toString(): String
    Definition Classes
    AnyRef → Any
  19. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  22. implicit object JoinableTInt extends JoinableTInt[Input]

    Implicit object representing a JoinableTInt instance for the type Input.

    Implicit object representing a JoinableTInt instance for the type Input.

    This implicit ensures that the JoinableTInt operations (such as join, zero, and valid) are defined for (Input, Int) based on the behavior of an implicitly available Joinable[Input] instance.

    Definitions: - Joinable: A type class that defines how to join elements of a type, provide a zero value, and validate elements. - JoinableTInt: A specialized Joinable for tuples of type (T, Int), where the joining logic relies on the Joinable[T] instance for the first element of the tuple.

    Usage: - This implicit object provides JoinableTInt behavior for (Input, Int) automatically, provided there is an implicit Joinable[Input] in scope.

    Details: - The tj member refers to the Joinable[Input] instance, obtained implicitly.

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from InputTransformer[Input, Row]

Inherited from InputPreprocessor[Input, Row]

Inherited from AnyRef

Inherited from Any

Ungrouped