001    /*
002     * Copyright (c) 2004 World Wide Web Consortium,
003     *
004     * (Massachusetts Institute of Technology, European Research Consortium for
005     * Informatics and Mathematics, Keio University). All Rights Reserved. This
006     * work is distributed under the W3C(r) Software License [1] in the hope that
007     * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
008     * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
009     *
010     * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
011     */
012    
013    package org.w3c.dom;
014    
015    /**
016     *  The <code>DOMStringList</code> interface provides the abstraction of an
017     * ordered collection of <code>DOMString</code> values, without defining or
018     * constraining how this collection is implemented. The items in the
019     * <code>DOMStringList</code> are accessible via an integral index, starting
020     * from 0.
021     * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>.
022     * @since DOM Level 3
023     */
024    public interface DOMStringList {
025        /**
026         *  Returns the <code>index</code>th item in the collection. If
027         * <code>index</code> is greater than or equal to the number of
028         * <code>DOMString</code>s in the list, this returns <code>null</code>.
029         * @param index Index into the collection.
030         * @return  The <code>DOMString</code> at the <code>index</code>th
031         *   position in the <code>DOMStringList</code>, or <code>null</code> if
032         *   that is not a valid index.
033         */
034        public String item(int index);
035    
036        /**
037         * The number of <code>DOMString</code>s in the list. The range of valid
038         * child node indices is 0 to <code>length-1</code> inclusive.
039         */
040        public int getLength();
041    
042        /**
043         *  Test if a string is part of this <code>DOMStringList</code>.
044         * @param str  The string to look for.
045         * @return  <code>true</code> if the string has been found,
046         *   <code>false</code> otherwise.
047         */
048        public boolean contains(String str);
049    
050    }