Class/Object

molecule.seg

Seg

Related Docs: object Seg | package seg

Permalink

abstract class Seg[+A] extends AnyRef

Collection of messages carried on channels.

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

Instance Constructors

  1. new Seg()

    Permalink

Abstract Value Members

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

    Permalink

    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]

    Permalink

    Prepend an message to this segment

    Prepend an message to this segment

    b

    the message

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

    Permalink

    Append an message to this segment

    Append an message to this segment

    b

    the message

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

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

    Permalink

    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.

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

    Permalink

    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.

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

    Permalink

    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.

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

    Permalink

    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.

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

    Permalink

    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.

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

    Permalink

    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.

  11. abstract def head: A

    Permalink

    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.

  12. abstract def init: Seg[A]

    Permalink

    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.

  13. abstract def isEmpty: Boolean

    Permalink

    Tests whether this segment is empty.

    Tests whether this segment is empty.

    returns

    true if the segment contain no messages, false otherwise.

  14. abstract def last: A

    Permalink

    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.

  15. abstract def length: Int

    Permalink

    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.

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

    Permalink

    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.

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

    Permalink

    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.

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

    Permalink

    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.

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

    Permalink

    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.

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

    Permalink

    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.

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

    Permalink

    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.

  22. abstract def tail: Seg[A]

    Permalink

    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.

  23. abstract def toVector: Vector[A]

    Permalink

    Copies values of this segment to a vector.

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

    Permalink

    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: Any): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

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

    Permalink

    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.

  6. def clone(): AnyRef

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

    Permalink

    [use case]

    [use case]
    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 given partial function pf to each message on which it is defined and collecting the results. The order of the messages is preserved.

    Full Signature

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

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

    Permalink

    [use case]

    [use case]
    B

    the type of the messages of each traversable collection.

    returns

    a new segment resulting from concatenating all segments.

    Full Signature

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

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

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. abstract def flatMap[B](f: (A) ⇒ Seg[B]): Seg[B]

    Permalink

    [use case]

    [use case]
    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.

    Full Signature

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

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

    Permalink

    [use case]

    [use case]
    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.

    Full Signature

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

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

    Permalink

    [use case]

    [use case]
    B

    the type of the messages of each traversable collection.

    returns

    a new segment resulting from concatenating all message.

    Full Signature

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

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

    Permalink

    [use case]

    [use case]
    f

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

    Full Signature

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

  16. final def getClass(): Class[_]

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

    Permalink
  18. def hashCode(): Int

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

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

    Permalink

    [use case]

    [use case]
    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.

    Full Signature

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

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

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

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

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

    Permalink

    Poison all messages in this segment

    Poison all messages in this segment

    m

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

  25. final def size: Int

    Permalink

    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()
  26. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped