LimeWire collection component api

org.limewire.collection
Class MultiIterable<T>

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

public class MultiIterable<T>
extends java.lang.Object
implements java.lang.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(java.lang.Iterable<? extends java.lang.Iterable<? extends T>> iterables)
           
MultiIterable(java.lang.Iterable<? extends T>... iterables)
          Catch-all constructor.
MultiIterable(java.lang.Iterable<? extends T> i1, java.lang.Iterable<? extends T> i2)
           
MultiIterable(java.lang.Iterable<? extends T> i1, java.lang.Iterable<? extends T> i2, java.lang.Iterable<? extends T> i3)
           
MultiIterable(java.lang.Iterable<? extends T> i1, java.lang.Iterable<? extends T> i2, java.lang.Iterable<? extends T> i3, java.lang.Iterable<? extends T> i4)
           
 
Method Summary
 java.util.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(java.lang.Iterable<? extends T> i1,
                     java.lang.Iterable<? extends T> i2)

MultiIterable

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

MultiIterable

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

MultiIterable

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


MultiIterable

public MultiIterable(java.lang.Iterable<? extends java.lang.Iterable<? extends T>> iterables)
Method Detail

iterator

public java.util.Iterator<T> iterator()
Specified by:
iterator in interface java.lang.Iterable<T>

LimeWire collection component api

Copyright © 2009 Lime Wire LLC. All Rights Reserved.