io.dylemma.xml

IterateeHelpers

object IterateeHelpers extends IterateeHelpers

Created by dylan on 10/10/2015.

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

Type Members

  1. case class ErrorCountState[A](result: Result[A], numErrorsEmitted: Int = 0) extends Product with Serializable

    Represents a current result, and a count of previous results that were Errors.

  2. class IdentityStateAccumulator[E] extends StateAccumulator[E, E]

    StateAccumulator that uses the latest event as its state, ignoring any previous 'state' value.

  3. case class OpenTag(name: QName, attrs: Map[QName, String]) extends Product with Serializable

    Definition Classes
    IterateeHelpers
  4. trait StateAccumulator[S, E] extends AnyRef

    Definition Classes
    IterateeHelpers
  5. trait Subdivided[E, Ctx] extends AnyRef

    Intermediate result for subdivide and subdivideOnState.

  6. type TagStack = List[OpenTag]

    Definition Classes
    IterateeHelpers

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. object TagStackAccumulator extends StateAccumulator[TagStack, XMLEvent]

    State accumulator that keeps track of the open elements and their attributes.

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def collectNonEmpty[A](implicit ec: ExecutionContext): Enumeratee[Result[A], Result[A]]

    Definition Classes
    IterateeHelpers
  10. def consumeConcat[A, B, That](implicit ec: ExecutionContext, t: (A) ⇒ TraversableOnce[B], bf: CanBuildFrom[A, B, That]): Iteratee[Result[A], Result[That]]

    Definition Classes
    IterateeHelpers
  11. def consumeList[A](implicit ec: ExecutionContext): Iteratee[Result[A], Result[List[A]]]

    Definition Classes
    IterateeHelpers
  12. def consumeOptional[A](implicit ec: ExecutionContext): Iteratee[Result[A], Result[Option[A]]]

    Definition Classes
    IterateeHelpers
  13. def consumeSingle[A](implicit ec: ExecutionContext): Iteratee[Result[A], Result[A]]

    Definition Classes
    IterateeHelpers
  14. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  16. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. def foldErrorCounts[A]: Enumeratee[Result[A], ErrorCountState[A]]

    An Enumeratee that accumulates an error count for results passed through it.

    An Enumeratee that accumulates an error count for results passed through it. The numErrorsEmitted counter will increment **after** a state with an error result. In this manner, the first error passed through will be accompanied by numErrorsEmitted = 0, but the very next event will have numErrorsEmitted = 1. This behavior can be used in combination with a TakeWhile enumeratee to limit the number of errors accepted by the downstream consumers, or kill the stream at (or just after) an error.

    A

    The type of the results being passed through

    Definition Classes
    IterateeHelpers
  18. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  19. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  20. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  21. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  24. def prepend[T](toPrepend: T): Enumeratee[T, T]

    Creates an enumeratee that prepends the given value

    Creates an enumeratee that prepends the given value

    toPrepend

    The value to prepend

    Definition Classes
    IterateeHelpers
  25. def runSideEffect[A](thunk: (Result[A]) ⇒ Unit)(implicit ec: ExecutionContext): Iteratee[Result[A], Result[Unit]]

    Definition Classes
    IterateeHelpers
  26. def scanResultsWith[A, B](s: StreamScan[A, B])(implicit ec: ExecutionContext): Enumeratee[Result[A], Result[B]]

    Create a new Enumeratee that advances a "state" based on the values of the incoming results.

    Create a new Enumeratee that advances a "state" based on the values of the incoming results. Empty inputs will be ignored. Error results will be passed through, but will cause the state to be reset to the folder's initial state.

    A

    The type of Result accepted by the returned Enumeratee

    B

    The type of Result generated by the returned Enumeratee

    s

    A StreamScan that folds values of type A into a State, producing results of type B.

    Definition Classes
    IterateeHelpers
  27. def scanWith[State, A, B](s: StreamScan[A, B])(implicit ec: ExecutionContext): Enumeratee[Result[A], Result[B]]

    Create a new Enumeratee that advances a "state" based on incoming results.

    Create a new Enumeratee that advances a "state" based on incoming results. Errors and Empty results will be ignored, while Success results will have their values passed through the given StreamScan to produce new results. When the stream reaches an EOF, any remaining state will be 'finished' to potentially create one final result.

    A

    The type of values that go into the StreamScan

    B

    The type of results that come out of the StreamScan

    s

    A StreamScan that folds values of type A into a State, producing results of type B.

    returns

    Definition Classes
    IterateeHelpers
  28. def subdivide[E](filter: (E) ⇒ Boolean)(implicit ec: ExecutionContext): Subdivided[E, E]

    Simplified case of subdivide, where the "state" is ignored, and the "context" is defined by whichever events match the given filter.

    Simplified case of subdivide, where the "state" is ignored, and the "context" is defined by whichever events match the given filter. When using combineWith, the context will be whichever event happens to be first in that substream.

    E
    filter
    ec
    returns

    Definition Classes
    IterateeHelpers
  29. def subdivide[E, State, Ctx](stateAccum: StateAccumulator[State, E], matchContext: (State) ⇒ Result[Ctx])(implicit ec: ExecutionContext): Subdivided[E, Ctx]

    Creates an Enumeratee that divides the incoming stream into substreams of consecutive events that match some context.

    Creates an Enumeratee that divides the incoming stream into substreams of consecutive events that match some context. Events are folded through a state accumulator in order to determine a "state" for each event. Then each state is passed through a context matching function to determine an optional context value for the event. The context matched by the first event in each substream can then be used to create an Iteratee that consumes that substream. The resulting Enumeratee feeds the result of each substream's consumer (Iteratee).

    E

    The event type

    State

    The state type

    Ctx

    The context type

    stateAccum

    StateAccumulator used to determine some "state" value for each event

    matchContext

    Context-matching function that will be called on each event's "state".

    ec

    implicit ExecutionContext used to combine inner Iteratees and Enumeratees

    returns

    A Subdivided instance that can be combined with an Iteratee, creating an Enumeratee that produces the results of running that Iteratee on each substream

    Definition Classes
    IterateeHelpers
  30. def subdivideXml[C](matchContext: (TagStack) ⇒ Result[C])(implicit ec: ExecutionContext): Subdivided[XMLEvent, C]

    subdivide variant for XMLEvents that uses an accumulated TagStack as the input to the context matcher.

    subdivide variant for XMLEvents that uses an accumulated TagStack as the input to the context matcher.

    C
    matchContext
    ec
    returns

    Definition Classes
    IterateeHelpers
  31. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  32. def takeThroughFirstError[A](implicit ec: ExecutionContext): Enumeratee[Result[A], Result[A]]

    Shortcut for takeThroughNthError(1).

    Shortcut for takeThroughNthError(1). An Enumeratee that feeds through Results of type A until just after the 1st Error result.

    A

    The type of Results being passed through

    Definition Classes
    IterateeHelpers
  33. def takeThroughNthError[A](n: Int)(implicit ec: ExecutionContext): Enumeratee[Result[A], Result[A]]

    An Enumeratee that feeds through Results of type A until just after the nth Error result.

    An Enumeratee that feeds through Results of type A until just after the nth Error result. In other words, streams transformed by this Enumeratee will contain **at most** n Errors, and will end after the nth error.

    A

    The type of Results being passed through

    n

    The number of errors to be passed through before ending the stream

    Definition Classes
    IterateeHelpers
  34. def takeUntilFirstError[A](implicit ec: ExecutionContext): Enumeratee[Result[A], Result[A]]

    Shortcut for takeUntilNthError(1).

    Shortcut for takeUntilNthError(1). An Enumeratee that feeds through Results of type A, treating the first Error result as an EOF.

    A

    Type type of Results being passed through

    Definition Classes
    IterateeHelpers
  35. def takeUntilNthError[A](n: Int)(implicit ec: ExecutionContext): Enumeratee[Result[A], Result[A]]

    An Enumeratee that feeds through Results of type A until just before the nth Error result.

    An Enumeratee that feeds through Results of type A until just before the nth Error result. In other words, streams transformed by this Enumeratee will contain **less than** n Errors, and will end before passing through the nth error.

    A

    The type of Results being passed through

    n

    The error count threshold before the stream is stopped

    Definition Classes
    IterateeHelpers
  36. def toString(): String

    Definition Classes
    AnyRef → Any
  37. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. def zipWithState[S, E](s: StateAccumulator[S, E])(implicit ec: ExecutionContext): Enumeratee[E, (S, E)]

    Creates an enumeratee that pairs its inputs with an accumulated state.

    Creates an enumeratee that pairs its inputs with an accumulated state.

    s

    An accumulator object whose init value will be used as the first state, and whose update function will be used to step from one state to the next given an input.

    Definition Classes
    IterateeHelpers
  41. def zipWithState[S, E](init: S, step: (S, E) ⇒ S)(implicit ec: ExecutionContext): Enumeratee[E, (S, E)]

    Create an enumeratee that pairs its inputs with an accumulated state.

    Create an enumeratee that pairs its inputs with an accumulated state.

    init

    The initial state value

    step

    A function that takes a state and an input, returning a new state

    Definition Classes
    IterateeHelpers

Inherited from IterateeHelpers

Inherited from AnyRef

Inherited from Any

Ungrouped