1 /*
   2  * reserved comment block
   3  * DO NOT REMOVE OR ALTER!
   4  */
   5 /*
   6  * Copyright 2003,2004 The Apache Software Foundation.
   7  *
   8  * Licensed under the Apache License, Version 2.0 (the "License");
   9  * you may not use this file except in compliance with the License.
  10  * You may obtain a copy of the License at
  11  *
  12  *      http://www.apache.org/licenses/LICENSE-2.0
  13  *
  14  * Unless required by applicable law or agreed to in writing, software
  15  * distributed under the License is distributed on an "AS IS" BASIS,
  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17  * See the License for the specific language governing permissions and
  18  * limitations under the License.
  19  */
  20 
  21 package com.sun.org.apache.xerces.internal.xs;
  22 
  23 import java.util.Map;
  24 
  25 /**
  26  * Objects implementing the <code>XSNamedMap</code> interface are used to
  27  * represent immutable collections of XML Schema components that can be
  28  * accessed by name. Note that <code>XSNamedMap</code> does not inherit from
  29  * <code>XSObjectList</code>. The <code>XSObject</code>s in
  30  * <code>XSNamedMap</code>s are not maintained in any particular order.
  31  */
  32 public interface XSNamedMap extends Map {
  33     /**
  34      * The number of <code>XSObjects</code> in the <code>XSObjectList</code>.
  35      * The range of valid child object indices is 0 to <code>length-1</code>
  36      * inclusive.
  37      */
  38     public int getLength();
  39 
  40     /**
  41      *  Returns the <code>index</code>th item in the collection or
  42      * <code>null</code> if <code>index</code> is greater than or equal to
  43      * the number of objects in the list. The index starts at 0.
  44      * @param index  index into the collection.
  45      * @return  The <code>XSObject</code> at the <code>index</code>th
  46      *   position in the <code>XSObjectList</code>, or <code>null</code> if
  47      *   the index specified is not valid.
  48      */
  49     public XSObject item(int index);
  50 
  51     /**
  52      * Retrieves an <code>XSObject</code> specified by local name and
  53      * namespace URI.
  54      * <br>Per XML Namespaces, applications must use the value <code>null</code> as the
  55      * <code>namespace</code> parameter for methods if they wish to specify
  56      * no namespace.
  57      * @param namespace The namespace URI of the <code>XSObject</code> to
  58      *   retrieve, or <code>null</code> if the <code>XSObject</code> has no
  59      *   namespace.
  60      * @param localName The local name of the <code>XSObject</code> to
  61      *   retrieve.
  62      * @return A <code>XSObject</code> (of any type) with the specified local
  63      *   name and namespace URI, or <code>null</code> if they do not
  64      *   identify any object in this map.
  65      */
  66     public XSObject itemByName(String namespace,
  67                                String localName);
  68 
  69 }