Trait/Object

io.dylemma.spac

Consumer

Related Docs: object Consumer | package spac

Permalink

trait Consumer[-In, +Out] extends AbstractHandlerFactory[In, Out, Id, Consumer]

An immutable object that can be used to create Handlers.

Self Type
Consumer[In, Out]
Source
Consumer.scala
Linear Supertypes
AbstractHandlerFactory[In, Out, Id, Consumer], HandlerFactory[In, Id[Out]], (Any) ⇒ HandlerFactory[In, Id[Out]], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Consumer
  2. AbstractHandlerFactory
  3. HandlerFactory
  4. Function1
  5. AnyRef
  6. Any
Implicitly
  1. by ConsumerFollowedByOps
  2. by any2stringadd
  3. by StringFormat
  4. by Ensuring
  5. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def makeHandler(): Handler[In, Id[Out]]

    Permalink
    Definition Classes
    HandlerFactory

Concrete Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from Consumer[In, Out] to any2stringadd[Consumer[In, Out]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (Consumer[In, Out], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Consumer[In, Out] to ArrowAssoc[Consumer[In, Out]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. def andThen[A](g: (HandlerFactory[In, Id[Out]]) ⇒ A): (Any) ⇒ A

    Permalink
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  7. def apply(v1: Any): HandlerFactory[In, Id[Out]]

    Permalink

    Always returns this, so that this can be passed to Splitter#through

    Always returns this, so that this can be passed to Splitter#through

    Definition Classes
    HandlerFactory → Function1
  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def compose[A](g: (A) ⇒ Any): (A) ⇒ HandlerFactory[In, Id[Out]]

    Permalink
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  11. def consume[S](source: S)(implicit consume: ConsumableLike[S, In]): Out

    Permalink
  12. def ensuring(cond: (Consumer[In, Out]) ⇒ Boolean, msg: ⇒ Any): Consumer[In, Out]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Consumer[In, Out] to Ensuring[Consumer[In, Out]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: (Consumer[In, Out]) ⇒ Boolean): Consumer[In, Out]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Consumer[In, Out] to Ensuring[Consumer[In, Out]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: Boolean, msg: ⇒ Any): Consumer[In, Out]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Consumer[In, Out] to Ensuring[Consumer[In, Out]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: Boolean): Consumer[In, Out]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Consumer[In, Out] to Ensuring[Consumer[In, Out]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. def followedBy: FollowedBy[[+T2]Consumer[In, T2], Out]

    Permalink

    An intermediate object with an apply and flatMap that both create a sequenced consumer which combines this consumer with a function to create the next one.

    An intermediate object with an apply and flatMap that both create a sequenced consumer which combines this consumer with a function to create the next one.

    Examples:

    val c1: Consumer[In, A] = /* ... */
    def getC2(c1Result: A): Consumer[In, B] = /* ... */
    val combined: Consumer[In, B] = c1.followedBy(getC2)
    
    // alternative `flatMap` syntax
    val combined: Consumer[In, B] = for {
      c1Result <- c1.followedBy
      c2Result <- getC2(c1Result)
    } yield c2Result

    An example of where this is useful is when a parser for XML element depends on values parsed from one of its previous siblings, but where you don't want to wait until the end of their parent element before they can be combined.

    returns

    An intermediate object which has an apply and flatMap that can be used to combine this Consumer and another in a sequence.

    Implicit information
    This member is added by an implicit conversion from Consumer[In, Out] to spac.ConsumerFollowedByOps[In, Out] performed by method ConsumerFollowedByOps in io.dylemma.spac.syntax.ConsumerSyntax. This conversion will take place only if In is context-bounded by io.dylemma.spac.types.Stackable (In: Stackable).
    Definition Classes
    ConsumerFollowedByOps
  20. def followedByStream: FollowedBy[[+T2]Transformer[In, T2], Out]

    Permalink

    An intermediate object with an apply and flatMap that can be used to create a Transformer from result of this consumer.

    An intermediate object with an apply and flatMap that can be used to create a Transformer from result of this consumer.

    Examples:

    val c1: Consumer[In, A] = /* ... */
    def getStream(c1Result: A): Transformer[In, B] = /* ... */
    val combined: Transformer[In, B] = c1.followedByStream(getStream)
    
    // alternative `flatMap` syntax
    val combined: Transformer[In, B] = for {
      c1Result <- c1.followedByStream
      c2Result <- getStream(c1Result)
    } yield c2Result

    An example of where this is useful is when an XML element contains some "dictionary" object at the beginning, followed by a sequence of "data" objects which reference the dictionary. For large sequences, combining them to a List (to use with Parser's and combiners) is undesireable; we can use this approach to avoid doing so.

    returns

    An intermediate object which has an apply and flatMap that can be used to combine this consumer and a Transformer in a sequence.

    Implicit information
    This member is added by an implicit conversion from Consumer[In, Out] to spac.ConsumerFollowedByOps[In, Out] performed by method ConsumerFollowedByOps in io.dylemma.spac.syntax.ConsumerSyntax. This conversion will take place only if In is context-bounded by io.dylemma.spac.types.Stackable (In: Stackable).
    Definition Classes
    ConsumerFollowedByOps
  21. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from Consumer[In, Out] to StringFormat[Consumer[In, Out]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  22. final def getClass(): Class[_]

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

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

    Permalink
    Definition Classes
    Any
  25. def map[B](f: (Out) ⇒ B): Consumer[In, B]

    Permalink

    Create a new handler factory whose results are transformed by the given function f.

    Create a new handler factory whose results are transformed by the given function f.

    B

    The mapped result type

    f

    The function to apply to each result

    returns

    A new handler factory which derives its results by applying f to the results generated by this handler factory

    Definition Classes
    AbstractHandlerFactory
    See also

    syntax.FunctorSyntax.NestedFunctorOps#mapF for when Out is a container e.g. Option or List

  26. def mapResult[U](f: (Id[Out]) ⇒ Id[U]): Consumer[In, U]

    Permalink

    Create a new handler factory whose result containers are transformed by the given function f.

    Create a new handler factory whose result containers are transformed by the given function f. For Consumers, which use Id as the result container type, mapResult is equivalent to map.

    f

    The function applied to each result container

    returns

    a new HandlerFactory which derives its results by applying f to the result containers generated by this handler factory

    Definition Classes
    ConsumerAbstractHandlerFactory
  27. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  28. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  29. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  31. def toString(): String

    Permalink
    Definition Classes
    Function1 → AnyRef → Any
  32. def unwrapSafe[T](implicit ev: <:<[Out, Try[T]]): Consumer[In, T]

    Permalink
  33. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. def wrapSafe: Consumer[In, Try[Out]]

    Permalink
  37. def [B](y: B): (Consumer[In, Out], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Consumer[In, Out] to ArrowAssoc[Consumer[In, Out]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AbstractHandlerFactory[In, Out, Id, Consumer]

Inherited from HandlerFactory[In, Id[Out]]

Inherited from (Any) ⇒ HandlerFactory[In, Id[Out]]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion ConsumerFollowedByOps from Consumer[In, Out] to spac.ConsumerFollowedByOps[In, Out]

Inherited by implicit conversion any2stringadd from Consumer[In, Out] to any2stringadd[Consumer[In, Out]]

Inherited by implicit conversion StringFormat from Consumer[In, Out] to StringFormat[Consumer[In, Out]]

Inherited by implicit conversion Ensuring from Consumer[In, Out] to Ensuring[Consumer[In, Out]]

Inherited by implicit conversion ArrowAssoc from Consumer[In, Out] to ArrowAssoc[Consumer[In, Out]]

Ungrouped