All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----collections.InterleavingEnumeration
The elements are revealed (via nextElement()) in a purely interleaved fashion, alternating between the first and second enumerations unless one of them has been exhausted, in which case all remaining elements of the other are revealed until it too is exhausted.
InterleavingEnumerations work as wrappers around other Enumerations. To build one, you need two existing Enumerations. For example, if you want to process together the elements of two Collections a and b, you could write something of the form:
Enumeration items = InterleavingEnumeration(a.elements(), b.elements()); while (items.hasMoreElements()) doSomethingWith(items.nextElement());
public InterleavingEnumeration(Enumeration fst, Enumeration snd)
public synchronized boolean hasMoreElements()
public synchronized Object nextElement()
All Packages Class Hierarchy This Package Previous Next Index