t

Stream._consume._evaluate

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

Evaluate Interface

Most methods search for certain data and stop once found

The pipeline, in most cases, is discarded not fully pumped

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 contains[B >: A](value: B): Boolean

    Includes check

    Includes check

    Returns true if there is element equal to the given value

    def all = ('a' <> 'f').all
    
    all.contains('c').lp       // Prints: true
    
    all.contains('y').lp       // Prints: false
    Definition Classes
    _evaluate_evaluate
  4. def count(f: Filter[A]): Int

    Element conditional count

    Element conditional count

    Returns count of elements satisfying the filter

    Definition Classes
    _evaluate_evaluate
  5. def count: Int

    All elements count

    All elements count

    Returns count of all elements

    ('a' <> 'z').all.count.lp  // Prints: 26
    Definition Classes
    _evaluate_evaluate
  6. def countAndTime: (Int, Duration)

    Element count and time

    Element count and time

    Returns count of all elements and the Duration it took to pump the pipeline

    (1 <> 1000).all.peek(_ => App.pause(1.Millis)).countAndTime.lp // Prints: (1000,1.004 sec)
    Definition Classes
    _evaluate_evaluate
  7. def countFew(f: Filter[A]*): Idx[Int]

    Element multi count

    Element multi count

    Counts elements for several filters at once

    Returns Idx[Int], where each Int corresponds to the given filter index

    If the pipeline is empty, the resulting Idx will still hold 0 in each position, but will test isVoid positive

    f

    several filters

    Definition Classes
    _evaluate_evaluate
    Example:
    1. val (all, odd, even) = (1 <> 50).all.countFew(ANY, _ % 2 == 1, _ % 2 == 0).toTuple3
      
      "all=" + all lp;    // Prints: all=50
      "odd=" + odd lp;    // Prints: odd=25
      "even=" + even lp;  // Prints: even=25
      
       // ----------------------------------------------------------------------------------
      
      def count(stream: ~[Int]): Idx[Int] = stream.countFew(_ < 10, _ > 20, 30 <> 60)
      
      count(1 <> 50).all lp  // Prints: ~(9, 30, 21)
      
      count(\/).all lp       // Prints: ~(0, 0, 0)
      
      count(\/).Opt lp       // Prints: Opt.Void
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def find(f: Filter[A]): A

    Find

    Find

    Returns the first element satisfying the given filter

    Fails if none found

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

    Find index

    Find index

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

    (50 <> 500).all.findIdxOpt(_ == 400).lp // Prints: Opt(350)
    Definition Classes
    _evaluate
  14. def findOpt(f: Filter[A]): Opt[A]

    Find

    Find

    Optionally returns the first element satisfying the given filter

    (1 <> 1000).all.findOpt(_ > 100).lp  // Prints: Opt(101)
    Definition Classes
    _evaluate_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 = (1 <> 100).all
    
    all.isAny(_ > 10).lp   // Prints: true
    
    all.isAny(_ > 100).lp  // Prints: false
    Definition Classes
    _evaluate_evaluate
  17. def isEvery(f: Filter[A]): Boolean

    Every check

    Every check

    Returns true if every element is satisfying the filter

    def all = (1 <> 100).all
    
    all.isEvery(_ > 10).lp   // Prints: false
    
    all.isEvery(_ > 0).lp    // Prints: true
    Definition Classes
    _evaluate_evaluate
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. def last: A

    Last element

    Last element

    Returns the last data element

    Fails if no data

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

    Last element

    Last element

    Optionally returns the last element or Opt.Void

    Definition Classes
    _evaluate
  21. def lookupOpt[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] + "ABC" + 1 + 22.0 + "DE" + 333F + "F"
    
    // Find length of the first matching string
    stream.lookupOpt{
      case s: String if (s.length > 1) => s.length
    }.lp    // Prints: Opt(3)
    Definition Classes
    _evaluate_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], 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 are equal, Opt.Void is returned

    (0 <> 10).all unequalOpt (0 <> 10) lp        // Prints: Opt.Void
    
    (0 <> 10).all unequalOpt (0 <>> 10) lp       // Prints: Opt(First has more elements)
    
    (0 <> 5).all + 7 + 8 unequalOpt (0 <> 10) lp // Prints: Opt(Fail at index 6: 7 != 6)
    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
Linear Supertypes
Source: _evaluate.scala