t
scalqa

Stream.Flow._consume._evaluate

trait _evaluate[A] extends AnyRef

Evaluate Interface

Self Type
Stream.Flow[A]
Ordering
  1. Alphabetic
Inherited
  1. Flow._consume._evaluate
  2. scala.AnyRef
  3. 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
  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
  5. def count(f: Filter[A]): Int

    Element conditional count

    Element conditional count

    Returns count of elements satisfying the filter

    Definition Classes
    _evaluate
  6. abstract def count: Int

    All elements count

    All elements count

    Returns count of all elements

    ('a' to 'z').all.count  // Returns 26
    Definition Classes
    _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
  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
  13. abstract def findAnyOpt: Opt[A]
    Attributes
    protected
    Definition Classes
    _evaluate
  14. 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
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  16. 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
  17. 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
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  22. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  23. def toString(): String
    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. 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