001    /*
002    // $Id: NamedList.java 229 2009-05-08 19:11:29Z jhyde $
003    // This software is subject to the terms of the Eclipse Public License v1.0
004    // Agreement, available at the following URL:
005    // http://www.eclipse.org/legal/epl-v10.html.
006    // Copyright (C) 2006-2008 Julian Hyde
007    // All Rights Reserved.
008    // You must accept the terms of that agreement to use this software.
009    */
010    package org.olap4j.metadata;
011    
012    import java.util.List;
013    
014    /**
015     * Extension to {@link java.util.List} which allows access to members of the
016     * list by name as well as by ordinal.
017     *
018     * @author jhyde
019     * @version $Id: NamedList.java 229 2009-05-08 19:11:29Z jhyde $
020     * @since Aug 22, 2006
021     */
022    public interface NamedList<E> extends List<E> {
023        /**
024         * Retrieves a member by name.
025         *
026         * @param name name of the element to return
027         *
028         * @see #get(int)
029         *
030         * @return the element of the list with the specified name, or null if
031         * there is no such element
032         */
033        E get(String name);
034    
035        /**
036         * Returns the position where a member of a given name is found, or -1
037         * if the member is not present.
038         *
039         * @param name name of the element to return
040         *
041         * @return the index of element of the list with the specified name, or -1
042         * if there is no such element
043         *
044         * @see #indexOf(Object)
045         */
046        int indexOfName(String name);
047    }
048    
049    // End NamedList.java