Class

io.dylemma.spac.Consumer

FirstOption

Related Doc: package Consumer

Permalink

case class FirstOption[A]() extends AbstractHandlerFactory[A, Option[A], Id, Consumer] with Consumer[A, Option[A]] with Product with Serializable

Source
Consumer.scala
Linear Supertypes
Serializable, Serializable, Product, Equals, Consumer[A, Option[A]], AbstractHandlerFactory[A, Option[A], Id, Consumer], HandlerFactory[A, Id[Option[A]]], (Any) ⇒ HandlerFactory[A, Id[Option[A]]], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FirstOption
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Consumer
  7. AbstractHandlerFactory
  8. HandlerFactory
  9. Function1
  10. AnyRef
  11. 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

Instance Constructors

  1. new FirstOption()

    Permalink

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 FirstOption[A] to any2stringadd[FirstOption[A]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (FirstOption[A], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from FirstOption[A] to ArrowAssoc[FirstOption[A]] 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[A, Id[Option[A]]]) ⇒ A): (Any) ⇒ A

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

    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[A, Id[Option[A]]]

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

    Permalink
    Definition Classes
    Consumer
  12. def ensuring(cond: (FirstOption[A]) ⇒ Boolean, msg: ⇒ Any): FirstOption[A]

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  17. def finalize(): Unit

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

    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 FirstOption[A] to spac.ConsumerFollowedByOps[A, Option[A]] performed by method ConsumerFollowedByOps in io.dylemma.spac.syntax.ConsumerSyntax. This conversion will take place only if A is context-bounded by io.dylemma.spac.types.Stackable (A: Stackable).
    Definition Classes
    ConsumerFollowedByOps
  19. def followedByStream: FollowedBy[[+T2]Transformer[A, T2], Option[A]]

    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 FirstOption[A] to spac.ConsumerFollowedByOps[A, Option[A]] performed by method ConsumerFollowedByOps in io.dylemma.spac.syntax.ConsumerSyntax. This conversion will take place only if A is context-bounded by io.dylemma.spac.types.Stackable (A: Stackable).
    Definition Classes
    ConsumerFollowedByOps
  20. def formatted(fmtstr: String): String

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

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

    Permalink
    Definition Classes
    Any
  23. def makeHandler(): Handler[A, Option[A]]

    Permalink
    Definition Classes
    FirstOptionHandlerFactory
  24. def map[B](f: (Option[A]) ⇒ B): Consumer[A, 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

  25. def mapResult[U](f: (Id[Option[A]]) ⇒ Id[U]): Consumer[A, 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
  26. final def ne(arg0: AnyRef): Boolean

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

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

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

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

    Permalink
    Definition Classes
    FirstOption → Function1 → AnyRef → Any
  31. def unwrapSafe[T](implicit ev: <:<[Option[A], Try[T]]): Consumer[A, T]

    Permalink
    Definition Classes
    Consumer
  32. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. def wrapSafe: Consumer[A, Try[Option[A]]]

    Permalink
    Definition Classes
    Consumer
  36. def [B](y: B): (FirstOption[A], B)

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

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Consumer[A, Option[A]]

Inherited from AbstractHandlerFactory[A, Option[A], Id, Consumer]

Inherited from HandlerFactory[A, Id[Option[A]]]

Inherited from (Any) ⇒ HandlerFactory[A, Id[Option[A]]]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion ConsumerFollowedByOps from FirstOption[A] to spac.ConsumerFollowedByOps[A, Option[A]]

Inherited by implicit conversion any2stringadd from FirstOption[A] to any2stringadd[FirstOption[A]]

Inherited by implicit conversion StringFormat from FirstOption[A] to StringFormat[FirstOption[A]]

Inherited by implicit conversion Ensuring from FirstOption[A] to Ensuring[FirstOption[A]]

Inherited by implicit conversion ArrowAssoc from FirstOption[A] to ArrowAssoc[FirstOption[A]]

Ungrouped