molecule.seg

Seg

abstract class Seg[+A] extends AnyRef

Collection of messages carried on channels.

Source
Seg.scala
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. Seg
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Seg()

Abstract Value Members

  1. abstract def ++[B >: A](seg: Seg[B]): Seg[B]

    Append a segment to this segment

    Append a segment to this segment

    Complexity is O(lmin) effective, where lmin is the length of the smallest segment.

    seg

    the segment

  2. abstract def +:[B >: A](b: B): Seg[B]

    Prepend an message to this segment

    Prepend an message to this segment

    b

    the message

  3. abstract def :+[B >: A](b: B): Seg[B]

    Append an message to this segment

    Append an message to this segment

    b

    the message

  4. abstract def collect[B](pf: PartialFunction[A, B])(implicit m: Message[A]): Seg[B]

    Builds a new collection by applying a partial function to all messages of this segment on which the function is defined.

    Builds a new collection by applying a partial function to all messages of this segment on which the function is defined.

    B

    the message type of the returned collection.

    pf

    the partial function which filters and maps the segment.

    m

    a message typeclass used to poison messages not collected.

    returns

    a new segment resulting from applying the partial function pf to each message on which it is defined and collecting the results. The order of the messages is preserved.

  5. abstract def concat[B](implicit asSeg: (A) ⇒ Seg[B]): Seg[B]

    Return a segments that concatenates all the segments it contains.

    Return a segments that concatenates all the segments it contains.

    B

    the type of the messages of each traversable collection.

    asSeg

    an implicit conversion which asserts that the message type of this segment is a Seg.

    returns

    a new segment resulting from concatenating all segments.

  6. abstract def copyTo[B >: A, That](builder: Builder[B, That]): Builder[B, That]

  7. abstract def drop(n: Int)(implicit m: Message[A]): Seg[A]

    Drops n elements from the head of this segment.

    Drops n elements from the head of this segment.

    n

    The number of elements to drop.

    m

    A message typeclass used to poison messages dropped.

    returns

    a segment whose n first elements have been dropped.

  8. abstract def dropRightWhile(p: (A) ⇒ Boolean)(implicit m: Message[A]): Seg[A]

    Drops longest suffix of messages that satisfy a predicate.

    Drops longest suffix of messages that satisfy a predicate.

    p

    The predicate used to test messages.

    m

    A message typeclass used to poison messages dropped.

    returns

    the longest prefix of this segment whose first message does not satisfy the predicate p.

  9. abstract def dropWhile(p: (A) ⇒ Boolean)(implicit m: Message[A]): Seg[A]

    Drops longest prefix of messages that satisfy a predicate.

    Drops longest prefix of messages that satisfy a predicate.

    p

    The predicate used to test messages.

    m

    A message typeclass used to poison messages dropped.

    returns

    the longest suffix of this segment whose first message does not satisfy the predicate p.

  10. abstract def exists(p: (A) ⇒ Boolean): Boolean

    Tests whether a predicate holds for some of the messages of this segment.

    Tests whether a predicate holds for some of the messages of this segment.

    p

    the predicate used to test messages.

    returns

    true if the given predicate p holds for some of the messages of this segment, otherwise false.

  11. abstract def filter(p: (A) ⇒ Boolean)(implicit m: Message[A]): Seg[A]

    Selects all messages of this segment which satisfy a predicate.

    Selects all messages of this segment which satisfy a predicate.

    p

    the predicate used to test messages.

    m

    a message typeclass used to poison messages filtered out (i.e. messages that do not satisfy p).

    returns

    a new segment consisting of all messages of this segment that satisfy the given predicate p. Their order may not be preserved.

  12. abstract def flatMap[B](f: (A) ⇒ Seg[B]): Seg[B]

    Builds a new collection by applying a function to all messages of this segment and concatenating the results.

    Builds a new collection by applying a function to all messages of this segment and concatenating the results.

    B

    the message type of the returned collection.

    f

    the function to apply to each message.

    returns

    a new segment resulting from applying the given collection-valued function f to each message of this segment and concatenating the results.

  13. abstract def flatMapTraversable[B](f: (A) ⇒ Traversable[B]): Seg[B]

    Builds a new collection by applying a function to all messages of this segment and concatenating the results.

    Builds a new collection by applying a function to all messages of this segment and concatenating the results.

    B

    the message type of the returned collection.

    f

    the function to apply to each message.

    returns

    a new segment resulting from applying the given collection-valued function f to each message of this segment and concatenating the results.

  14. abstract def flatten[B](implicit asTraversable: (A) ⇒ Traversable[B]): Seg[B]

    Converts this segment of traversable collections into a segment in which all message collections are concatenated.

    Converts this segment of traversable collections into a segment in which all message collections are concatenated.

    B

    the type of the messages of each traversable collection.

    asTraversable

    an implicit conversion which asserts that the message type of this segment is a Traversable.

    returns

    a new segment resulting from concatenating all message.

  15. abstract def foldLeft[B](z: B)(f: (B, A) ⇒ B): B

    Applies a binary operator to a start value and all messages of this segment, going left to right.

    Applies a binary operator to a start value and all messages of this segment, going left to right.

    B

    the result type of the binary operator.

    z

    the start value.

    returns

    the result of inserting op between consecutive messages of this segment, going left to right with the start value z on the left:

                op(...op(z, x,,1,,), x,,2,,, ..., x,,n,,)
    

    where x1, ..., xn are the messages of this segment.

  16. abstract def foreach[U](f: (A) ⇒ U): Unit

    Applies a function f to all messages of this segments.

    Applies a function f to all messages of this segments.

    U

    the type parameter describing the result of function f. This result will always be ignored. Typically U is Unit, but this is not necessary.

    f

    the function that is applied for its side-effect to every message. The result of function f is discarded.

  17. abstract def head: A

    Selects the first message of this segment.

    Selects the first message of this segment.

    returns

    the first message of this segment.

    Exceptions thrown
    `NoSuchmessageException`

    if the segment is empty.

  18. abstract def init: Seg[A]

    Selects all messages except the last.

    Selects all messages except the last.

    returns

    a segment consisting of all messages of this segment except the last one.

    Exceptions thrown
    `UnsupportedOperationException`

    if the segment is empty.

  19. abstract def isEmpty: Boolean

    Tests whether this segment is empty.

    Tests whether this segment is empty.

    returns

    true if the segment contain no messages, false otherwise.

  20. abstract def last: A

    Selects all messages except the first.

    Selects all messages except the first.

    returns

    a segment consisting of all messages of this segment except the first one.

    Exceptions thrown
    `UnsupportedOperationException`

    if the segment is empty.

  21. abstract def length: Int

    The length of the segment.

    The length of the segment.

    Note: xs.length and xs.size yield the same result.

    returns

    the number of messages in this segment.

  22. abstract def map[B](f: (A) ⇒ B): Seg[B]

    Builds a new collection by applying a function to all messages of this segment.

    Builds a new collection by applying a function to all messages of this segment.

    B

    the message type of the returned collection.

    f

    the function to apply to each message.

    returns

    a new segment resulting from applying the given function f to each message of this segment and collecting the results.

  23. abstract def pop: (VSeg[A], Seg[A])

    Returns a tuple containing the head of this segment as a value segment and the tail of the segment.

    Returns a tuple containing the head of this segment as a value segment and the tail of the segment.

    returns

    a tuple containing the head of this segment as a value segment and the tail of the segment.

  24. abstract def scanLeft[B](z: B)(op: (B, A) ⇒ B): Seg[B]

    Produces a collection containing cummulative results of applying the operator going left to right.

    Produces a collection containing cummulative results of applying the operator going left to right.

    B

    the type of the messages in the resulting collection

    z

    the initial value

    op

    the binary operator applied to the intermediate result and the message

    returns

    a segment with the intermediate results, incuding the initial value.

  25. abstract def smap[S, B](z: S)(f: (S, A) ⇒ (S, B)): (S, Seg[B])

    Produces a collection containing cummulative results of applying the operator going left to right.

    Produces a collection containing cummulative results of applying the operator going left to right.

    B

    the type of the messages in the resulting collection

    z

    the initial state

    returns

    a segment with the intermediate results.

  26. abstract def span(p: (A) ⇒ Boolean): (Seg[A], Seg[A])

    Splits this segment into a prefix/suffix pair according to a predicate.

    Splits this segment into a prefix/suffix pair according to a predicate.

    Note: c span p is equivalent to (but possibly more efficient than) (c takeWhile p, c dropWhile p), provided the evaluation of the predicate p does not cause any side-effects.

    p

    the test predicate

    returns

    a pair consisting of the longest prefix of this segment whose messages all satisfy p, and the rest of this segment.

  27. abstract def splitAt(n: Int): (Seg[A], Seg[A])

    Splits this segment into two at a given position.

    Splits this segment into two at a given position. Note: c splitAt n is equivalent to (but possibly more efficient than) (c take n, c drop n).

    n

    the position at which to split.

    returns

    a pair of segments consisting of the first n messages of this segment, and the other messages.

  28. abstract def step[B](empty: ⇒ B, more: (A, Seg[A]) ⇒ B): B

    Catamorphism.

    Catamorphism.

    B

    the return type of the arguments.

    empty

    the value returned if the segment is empty.

    more

    the function applied to the head and the tail of the segment if it is not empty.

    returns

    the value returned by 'empty' or 'more' depending on if the segment is empty or not.

  29. abstract def tail: Seg[A]

    Selects all messages except the first.

    Selects all messages except the first.

    returns

    a segment consisting of all messages of this segment except the first one.

    Exceptions thrown
    `UnsupportedOperationException`

    if the segment is empty.

  30. abstract def toVector: Vector[A]

    Copies values of this segment to a vector.

  31. abstract def zip[B](seg: Seg[B]): (Seg[(A, B)], Option[Either[Seg[A], Seg[B]]])

    Returns a pair containing:

    Returns a pair containing:

    • the segment formed from this segment and another segment by combining corresponding elements in pairs.
    • An optional segment containing the remaining elements if one of the two segments is longer than the other.
    B

    the type of the second half of the returned pairs

    returns

    a new segment containing pairs consisting of corresponding elements of this segment and seg and an optional segment containing the remaining elements if one of the two segments is longer than the other

Concrete 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. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def break(p: (A) ⇒ Boolean): (Seg[A], Seg[A])

    Split a collection at the message that satisfies the predicate.

    Split a collection at the message that satisfies the predicate.

    p

    the test predicate

    returns

    a pair consisting of the longest prefix of this segment whose messages do not satisfy p, and the rest of this segment.

  8. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  9. abstract def collect[B](pf: PartialFunction[A, B]): Seg[B]

    [use case] Builds a new collection by applying a partial function to all messages of this segment on which the function is defined.

    [use case]

    Builds a new collection by applying a partial function to all messages of this segment on which the function is defined.

    B

    the message type of the returned collection.

    pf

    the partial function which filters and maps the segment.

    returns

    a new segment resulting from applying the partial function pf to each message on which it is defined and collecting the results. The order of the messages is preserved.

  10. abstract def concat[B]: Seg[B]

    [use case] Return a segments that concatenates all the segments it contains.

    [use case]

    Return a segments that concatenates all the segments it contains.

    B

    the type of the messages of each traversable collection.

    returns

    a new segment resulting from concatenating all segments.

  11. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  14. abstract def flatMap[B](f: (A) ⇒ Seg[B]): Seg[B]

    [use case] Builds a new collection by applying a function to all messages of this segment and concatenating the results.

    [use case]

    Builds a new collection by applying a function to all messages of this segment and concatenating the results.

    B

    the message type of the returned collection.

    f

    the function to apply to each message.

    returns

    a new segment resulting from applying the given collection-valued function f to each message of this segment and concatenating the results.

  15. abstract def flatMapTraversable[B](f: (A) ⇒ Traversable[B]): Seg[B]

    [use case] Builds a new collection by applying a function to all messages of this segment and concatenating the results.

    [use case]

    Builds a new collection by applying a function to all messages of this segment and concatenating the results.

    B

    the message type of the returned collection.

    f

    the function to apply to each message.

    returns

    a new segment resulting from applying the given collection-valued function f to each message of this segment and concatenating the results.

  16. abstract def flatten[B]: Seg[B]

    [use case] Converts this segment of traversable collections into a segment in which all message collections are concatenated.

    [use case]

    Converts this segment of traversable collections into a segment in which all message collections are concatenated.

    B

    the type of the messages of each traversable collection.

    returns

    a new segment resulting from concatenating all message.

  17. abstract def foreach(f: (A) ⇒ Unit): Unit

    [use case] Applies a function f to all messages of this segments.

    [use case]

    Applies a function f to all messages of this segments.

    f

    the function that is applied for its side-effect to every message. The result of function f is discarded.

  18. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  19. def groupBy[K](f: (A) ⇒ K): Map[K, Seg[A]]

  20. def hashCode(): Int

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

    Definition Classes
    Any
  22. abstract def map[B](f: (A) ⇒ B): Seg[B]

    [use case] Builds a new collection by applying a function to all messages of this segment.

    [use case]

    Builds a new collection by applying a function to all messages of this segment.

    B

    the message type of the returned collection.

    f

    the function to apply to each message.

    returns

    a new segment resulting from applying the given function f to each message of this segment and collecting the results.

  23. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  26. def poison(signal: Signal)(implicit m: Message[A]): Unit

    Poison all messages in this segment

    Poison all messages in this segment

    m

    a message typeclass used to poison every message in this segment.

  27. final def size: Int

    The size of the segment.

    The size of the segment.

    Note: xs.length and xs.size yield the same result.

    returns

    the number of messages in this segment.

    Annotations
    @inline()
  28. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  29. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any