001    package listFW;
002    
003    /**
004     * Defines an immutable list that holds elements of type E.
005     * Serves as a host for an algorithm on a list to visit its internal structure.
006     * Has a "hook" method to call on the appropriate method of the visitor, making
007     * the immutable list structure a framework.
008     * @author Dung X. Nguyen
009     * @author Stephen B. Wong
010     * @author Mathias Ricken - Copyright 2008 - All rights reserved.
011     * @since Copyright 2004 - DXN, SBW All rights reserved
012     * @stereotype host
013     */
014    public interface IList<E> {
015        /**
016         * A visitor pattern "hook" method that executes an <code>IListAlgo</code>.
017         * @param algo the visitor, the algorithm to be executed.  
018         * Any visitor that works on a super type of E is accepted.
019         * @param inp a generic input parameter to be used by the algorithm algo.
020         * @return <code>Object</code> output from executing the algorithm algo.
021         */
022        public abstract  <R,P>  R execute(IListAlgo<? super E, R, P> algo, P ... inp);
023    }
024