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