FileDocCategorySizeDatePackage
AppendIteratorFilter.javaAPI DocExample2699Mon Jul 23 13:26:56 BST 2007org.apache.struts2.util

AppendIteratorFilter

public class AppendIteratorFilter extends IteratorFilterSupport implements com.opensymphony.xwork2.Action, Iterator
A bean that takes several iterators and outputs them in sequence
see
org.apache.struts2.components.AppendIterator
see
org.apache.struts2.views.jsp.iterator.AppendIteratorTag

Fields Summary
List
iterators
List
sources
Constructors Summary
Methods Summary
public java.lang.Stringexecute()

        // Make source transformations
        for (int i = 0; i < sources.size(); i++) {
            Object source = sources.get(i);
            iterators.add(getIterator(source));
        }

        return SUCCESS;
    
public booleanhasNext()

        if (iterators.size() > 0) {
            return (((Iterator) iterators.get(0)).hasNext());
        } else {
            return false;
        }
    
public java.lang.Objectnext()

        try {
            return ((Iterator) iterators.get(0)).next();
        } finally {
            if (iterators.size() > 0) {
                if (!((Iterator) iterators.get(0)).hasNext()) {
                    iterators.remove(0);
                }
            }
        }
    
public voidremove()

        throw new UnsupportedOperationException();
    
public voidsetSource(java.lang.Object anIterator)



    // Public --------------------------------------------------------
        
        sources.add(anIterator);