scalax.data.collection

class FilterMap

[source: scalax/data/collection.scala]

class FilterMap[T](s : scala.Iterator[T])
extends AnyRef
Method Summary
def filterMap [B](f : scala.PartialFunction[T, B]) : scala.Iterator[B]
Given the partial function f, filter out elements over which f is undefined, and map the remaining elements with f. Note that this evaluates f twice for each element.
def filterMapOption [B](f : (T) => scala.Option[B]) : scala.Iterator[B]
Given the function f, filter out elements for which f returns None, and map the remaining elements with f, extracting the value from the Some. This evaluates f once for each element.
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
def filterMap[B](f : scala.PartialFunction[T, B]) : scala.Iterator[B]
Given the partial function f, filter out elements over which f is undefined, and map the remaining elements with f. Note that this evaluates f twice for each element.

def filterMapOption[B](f : (T) => scala.Option[B]) : scala.Iterator[B]
Given the function f, filter out elements for which f returns None, and map the remaining elements with f, extracting the value from the Some. This evaluates f once for each element.


Copyright (c) 2005-8 The Scalax Project. All Rights Reserved.