LimeWire Collection Component API

org.limewire.collection
Class MultiIterable<T>

java.lang.Object
  extended by org.limewire.collection.MultiIterable<T>
All Implemented Interfaces:
Iterable<T>
Direct Known Subclasses:
MultiCollection

public class MultiIterable<T>
extends Object
implements Iterable<T>

Lets you iterate over many Iterables easily.

    LinkedList<String> activeList = new LinkedList<String>();
    activeList.add("Abby");
    activeList.add("Bob");
    activeList.add("Chris");        

    LinkedList<String> inactiveList = new LinkedList<String>();
    inactiveList.add("Anderson");
    inactiveList.add("Baker");      

    for(String s : new MultiIterable<String>(activeList, inactiveList))
        System.out.println(s.toLowerCase());        

    Output:
        abby
        bob
        chris
        anderson
        baker

 


Constructor Summary
MultiIterable(Iterable<? extends T>... iterables)
          Catch-all constructor.
MultiIterable(Iterable<? extends T> i1)
           
MultiIterable(Iterable<? extends T> i1, Iterable<? extends T> i2)
           
MultiIterable(Iterable<? extends T> i1, Iterable<? extends T> i2, Iterable<? extends T> i3)
           
MultiIterable(Iterable<? extends T> i1, Iterable<? extends T> i2, Iterable<? extends T> i3, Iterable<? extends T> i4)
           
 
Method Summary
 Iterator<T> iterator()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiIterable

public MultiIterable(Iterable<? extends T> i1)

MultiIterable

public MultiIterable(Iterable<? extends T> i1,
                     Iterable<? extends T> i2)

MultiIterable

public MultiIterable(Iterable<? extends T> i1,
                     Iterable<? extends T> i2,
                     Iterable<? extends T> i3)

MultiIterable

public MultiIterable(Iterable<? extends T> i1,
                     Iterable<? extends T> i2,
                     Iterable<? extends T> i3,
                     Iterable<? extends T> i4)

MultiIterable

public MultiIterable(Iterable<? extends T>... iterables)
Catch-all constructor.

Method Detail

iterator

public Iterator<T> iterator()
Specified by:
iterator in interface Iterable<T>

LimeWire Collection Component API

Copyright © 2008 Lime Wire LLC. All Rights Reserved.