t
scalqa

Stream._consume._evaluate

trait _evaluate[A] extends Stream.Flow._consume._evaluate[A]

Evaluate Interface

Self Type
Stream[A]
Ordering
  1. Alphabetic
Inherited
  1. Stream._consume._evaluate
  2. Stream.Flow._consume._evaluate
  3. scala.AnyRef
  4. scala.Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Method

  1. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  2. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  3. def collectOpt[B](f: PartialFunction[A, B]): Opt[B]

    Find first matching option

    Find first matching option

    The matching element is mapped with the functions

    def stream = ~~[Any] + 1 + "ABC" + 22.0 + "DE" + 333F + "F"
    
    // Find length of the first matching string
    stream.collectOpt{
      case s: String if (s.length > 1) => s.length
    }.lp    // Prints: Opt(3)
    Definition Classes
    _evaluate_evaluate
  4. def contains[B >: A](value: B): Boolean

    Includes check

    Includes check

    Returns true if there is element equal to the given value

    def all: ~[Char] = 'a' to 'f'
    
    all.contains('c')       // Returns true
    
    all.contains('y')       // Returns false
    Definition Classes
    _evaluate_evaluate
  5. def count(f: Filter[A]): Int

    Element conditional count

    Element conditional count

    Returns count of elements satisfying the filter

    Definition Classes
    _evaluate_evaluate
  6. def count: Int

    All elements count

    All elements count

    Returns count of all elements

    ('a' to 'z').all.count  // Returns 26
    Definition Classes
    _evaluate_evaluate
  7. def countAndSeconds: (Int, Double)

    Element count and time

    Element count and time

    Returns total count and time in seconds it took to pump the pipeline from first to last elements

    val (count, seconds) = (1 to 1000).all.peek(_ => Thread.sleep(1)).countAndSeconds
    
    println("Count = " + count + ", done in " + seconds + " secs")
    
    // Output
    Count = 1000, done in 1.004261423 secs
    Definition Classes
    _evaluate
  8. def countFew(f: Filter[A]*): Seq[Int]

    Element multi count

    Element multi count

    Counts elements for several filters at once

    Returns Seq, where each Int corresponds to the given filter index

    val Seq(total, odd, even) = (1 to 50).all.countFew(_ => true, _ % 2 == 1, _ % 2 == 0)
    
    println("total=" + total + ", odd=" + odd + ", even=" + even)
    
    // Output
    total=50, odd=25, even=25
    f

    several filters

    Definition Classes
    _evaluate_evaluate
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def find(f: Filter[A]): A

    Find

    Find

    Returns the first element satisfying the given filter

    Fails if none found

    (1 to 1000).all.find(_ > 100)   // Returns 101
    Definition Classes
    _evaluate_evaluate
  13. def findAnyOpt: Opt[A]
    Attributes
    protected
    Definition Classes
    _evaluate_evaluate
  14. def findIdxOpt(f: Filter[A]): Opt.Int

    Find index

    Find index

    Optionally returns index for the first element satisfying the filter or Opt.Void if none found

    (50 to 500).all.findIdxOpt(_ == 400)  // Retuns Opt(350)
    Definition Classes
    _evaluate
  15. def findOpt(f: Filter[A]): Opt[A]

    Find

    Find

    Optionally returns the first element satisfying the given filter

    (1 to 1000).all.findOpt(_ > 100)   // Returns Opt(101)
    Definition Classes
    _evaluate_evaluate
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  17. def isAny(f: Filter[A]): Boolean

    Any check

    Any check

    Returns true if there is an element satisfying the filter

    def all: ~[Int] = 1 to 100
    
    all.isAny(_ > 10)   // Returns true
    
    all.isAny(_ > 100)  // Returns false
    Definition Classes
    _evaluate_evaluate
  18. def isEvery(f: Filter[A]): Boolean

    Every check

    Every check

    Returns true if every element is satisfying the filter

    def all: ~[Int] = 1 to 100
    
    all.isEvery(_ > 10)    // Returns false
    
    all.isEvery(_ > 0)     // Returns true
    Definition Classes
    _evaluate_evaluate
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. def last: A

    Last element

    Last element

    Returns the last stream element

    Fails if empty

    Definition Classes
    _evaluate
  21. def lastOpt: Opt[A]

    Last element

    Last element

    Optionally returns the last element or Opt.Void

    Definition Classes
    _evaluate
  22. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. final def notify(): Unit
    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  25. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  26. def toString(): String
    Definition Classes
    AnyRef → Any
  27. def unequalOpt(that: ~[A], firstIndex: Int = 0, check: (A, A) ⇒ Boolean = _ == _): Opt[String]

    Unequal check

    Unequal check

    Pumps both streams and compares all corresponding elements

    When first not equal pair is found, message is returned

    If all elements are equal, Opt.Void is returned

    (0 to 10).all unequalOpt (0 to 10)         // Prints: Opt.Void
    
    (0 to 10).all unequalOpt (0 until 10)      // Prints: Opt(First has more elements)
    
    (0 to 5).all + 7 + 8 unequalOpt (0 to 10)  // Prints: Opt(Fail at index 6: 7 != 6)
    firstIndex

    - start of element indexing for error messages

    check

    is the function to compare two elements

    Definition Classes
    _evaluate
  28. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. 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. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any