t

Stream._extend._add

trait _add[A] extends AnyRef

Stream Extension 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 <> 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' <> '9').all.appendAll('a' <> 'd').appendAll('A' <> '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 <>> 1).all.default(99).lp // Prints: ~(99)
    
    (1 <>> 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 insertAllAt(index: Int, that: ~[A]): ~[A]

    Insert stream at

    Insert stream at

    Creates a new Stream with that Stream inserted into this Stream

    index

    position in the current stream to insert elements at. If index is out of range, the elements are prepended or appended

    Definition Classes
    _add
    Example:
    1. ('a' <> 'f').all.insertAllAt(3, 'X' <> 'Z').lp
      
      // Output
      ~(a, b, c, X, Y, Z, d, e, f)
  11. def insertAt(index: Int, element: A): ~[A]

    Insert at

    Insert at

    Creates a new Stream with given element inserted into this Stream

    index

    position in the current stream to insert element at. If index is out of range, the element is prepended or appended

    ('a' <> 'd').all.insertAt(2, 'X').lp
    
     // Output
     ~(a, b, X, c, d)
    Definition Classes
    _add
  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 ~+ 1).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 <> 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' <> '9').all +~ ('a' <> 'd') +~ ('A' <> '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
Linear Supertypes
AnyRef, Any
Source: _add.scala