com.opensymphony.xwork2.util
Class ClassLoaderUtil.AggregateIterator<E>

java.lang.Object
  extended by com.opensymphony.xwork2.util.ClassLoaderUtil.AggregateIterator<E>
All Implemented Interfaces:
Iterator<E>
Enclosing class:
ClassLoaderUtil

static class ClassLoaderUtil.AggregateIterator<E>
extends Object
implements Iterator<E>

Aggregates Enumeration instances into one iterator and filters out duplicates. Always keeps one ahead of the enumerator to protect against returning duplicates.


Field Summary
(package private)  Enumeration<E> cur
           
(package private)  LinkedList<Enumeration<E>> enums
           
(package private)  Set<E> loaded
           
(package private)  E next
           
 
Constructor Summary
ClassLoaderUtil.AggregateIterator()
           
 
Method Summary
 ClassLoaderUtil.AggregateIterator<E> addEnumeration(Enumeration<E> e)
           
private  Enumeration<E> determineCurrentEnumeration()
           
 boolean hasNext()
           
private  E loadNext()
           
 E next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enums

LinkedList<Enumeration<E>> enums

cur

Enumeration<E> cur

next

E next

loaded

Set<E> loaded
Constructor Detail

ClassLoaderUtil.AggregateIterator

ClassLoaderUtil.AggregateIterator()
Method Detail

addEnumeration

public ClassLoaderUtil.AggregateIterator<E> addEnumeration(Enumeration<E> e)

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<E>

next

public E next()
Specified by:
next in interface Iterator<E>

determineCurrentEnumeration

private Enumeration<E> determineCurrentEnumeration()

loadNext

private E loadNext()

remove

public void remove()
Specified by:
remove in interface Iterator<E>


Copyright © 2000-2009 Apache Software Foundation. All Rights Reserved.