scalax.data

object IteratorHelp

[source: scalax/data/IteratorHelp.scala]

object IteratorHelp
extends AnyRef
Functions which wrap various Java-style generators into Iterators which can be used within scala 'for' comprehensions.
Method Summary
def findResult [A, B](iter : scala.Iterator[A], f : (A) => scala.Option[B]) : scala.Option[B]
Applies the supplied function to each value and returns the first Some result, if there is one.
def fromJava [A](i : java.util.Enumeration[A]) : scala.Iterator[A]
Wraps a Java Enumeration into a Scala Iterator.
def fromJava [A](i : java.util.Iterator[A]) : scala.Iterator[A]
Wraps a Java iterator into a Scala one.
def length (iter : scala.Iterator[Any]) : Int
def nonNegative (f : => Int) : scala.Iterator[Int]
Keeps running the block until it returns a negative number.
def nonNull [A <: AnyRef](f : => A) : scala.Iterator[A]
Keeps running the block until it returns null.
def resultSet [A](rs : java.sql.ResultSet)(f : => A) : scala.Iterator[A]
Returns the block value for each row of a ResultSet.
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 nonNull[A <: AnyRef](f : => A) : scala.Iterator[A]
Keeps running the block until it returns null.

def nonNegative(f : => Int) : scala.Iterator[Int]
Keeps running the block until it returns a negative number.

def fromJava[A](i : java.util.Iterator[A]) : scala.Iterator[A]
Wraps a Java iterator into a Scala one.

def fromJava[A](i : java.util.Enumeration[A]) : scala.Iterator[A]
Wraps a Java Enumeration into a Scala Iterator.

def resultSet[A](rs : java.sql.ResultSet)(f : => A) : scala.Iterator[A]
Returns the block value for each row of a ResultSet.

def findResult[A, B](iter : scala.Iterator[A], f : (A) => scala.Option[B]) : scala.Option[B]
Applies the supplied function to each value and returns the first Some result, if there is one.

def length(iter : scala.Iterator[Any]) : Int


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