jfun.util.yield
Class Iterables

java.lang.Object
  extended by jfun.util.yield.Iterables

public class Iterables
extends java.lang.Object

Utility class providing utility functions for Iterable.

Zephyr Business Solution

Author:
Ben Yu

Constructor Summary
Iterables()
           
 
Method Summary
static Iterable fromIterator(java.util.Iterator it)
          Transforms an Iterator object to an Iterable object.
static Iterable seq(Iterable[] arr)
          Create a new Iterable object that sequentially iterates through the Iterable objects in an array.
static Iterable seq(Iterable it1, Iterable it2)
          Create a new Iterable object that sequentially iterates through the given two Iterable object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Iterables

public Iterables()
Method Detail

seq

public static Iterable seq(Iterable it1,
                           Iterable it2)
Create a new Iterable object that sequentially iterates through the given two Iterable object.

Parameters:
it1 - the first Iterable object.
it2 - the second Iterable object.
Returns:
the new Iterable object.

seq

public static Iterable seq(Iterable[] arr)
Create a new Iterable object that sequentially iterates through the Iterable objects in an array.

Parameters:
arr - the array.
Returns:
the new Iterable object.

fromIterator

public static Iterable fromIterator(java.util.Iterator it)
Transforms an Iterator object to an Iterable object.

Parameters:
it - the Iterator object.
Returns:
the Iterable object.