t
scalqa

Stream._extend._add

trait _add[A] extends AnyRef

Stream Building Interface

Self Type
Stream[A]
Ordering
  1. Alphabetic
Inherited
  1. Stream._extend._add
  2. scala.AnyRef
  3. scala.Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Method

  1. def append(element: A): ~[A]

    Append

    Append

    Creates a new Stream with given element appended to this Stream

    (1 to 5).all.append(99).append(100).lp
    
    // Output
    ~(1, 2, 3, 4, 5, 99, 100)

    Note. append has operator alias '+'

    Definition Classes
    _add
  2. def appendAll(that: ~[A]): ~[A]

    Append all

    Append all

    Creates a new Stream with that Stream appended to this Stream

    ('1' to '9').all.appendAll('a' to 'd').appendAll('A' to 'D').lp
    
    // Output
    ~(1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, A, B, C, D)
    Definition Classes
    _add
  3. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  4. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  5. def default(element: ⇒ A): ~[A]

    Default element

    Default element

    If this Stream is empty, the given element will be appended

    Otherwise this Stream elements will not change

    (1 until 1).all.default(99).lp // Prints: ~(99)
    
    (1 until 5).all.default(99).lp // Prints: ~(1, 2, 3, 4)
    Definition Classes
    _add
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  10. def insert(index: Int, element: A): ~[A]

    Insert at

    Insert at

    Creates a new Stream with given element inserted into this Stream at given index

    If index is out of range, the element is prepended or appended

    ('a' to 'd').all.insert(2, 'X').lp
    
     // Output
     ~(a, b, X, c, d)
    Definition Classes
    _add
  11. def insertAll(index: Int, that: ~[A]): ~[A]

    Insert stream at

    Insert stream at

    Creates a new Stream with that Stream inserted into this Stream at given index

    If index is out of range, the elements are prepended or appended

    Definition Classes
    _add
    Example:
    1. ('a' to 'f').all.insertAll(3, 'X' to 'Z').lp
      
      // Output
      ~(a, b, c, X, Y, Z, d, e, f)
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  16. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  17. def toString(): String
    Definition Classes
    AnyRef → Any
  18. def unfold(f: Mapping[~[A], A]): ~[A]

    Lazy infinite stream

    Lazy infinite stream

    Lazily unfolds next value with a function taking all prior values

    // Unfoldifg Fibonacci Sequence
    
    (0 to 1).all.unfold(_.letLast(2).sum).take(20).lp
    
    // Output
    ~(0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181)
    Definition Classes
    _add
  19. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Operator

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(element: A): ~[A]

    Append

    Append

    Same as append

    Creates a new Stream with given element appended to this Stream

    (1 to 5).all + 99 + 100 lp
    
    // Output
    ~(1, 2, 3, 4, 5, 99, 100)
    Definition Classes
    _add
  4. def +~(that: ~[A]): ~[A]

    Append all

    Append all

    Same as appendAll

    Creates a new Stream with that Stream appended to this Stream

    ('1' to '9').all +~ ('a' to 'd') +~ ('A' to 'D') lp
    
    // Output
    ~(1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, A, B, C, D)
    Definition Classes
    _add
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any