Class XSNamedMapImpl

  • All Implemented Interfaces:
    Map, XSNamedMap
    Direct Known Subclasses:
    XSNamedMap4Types

    public class XSNamedMapImpl
    extends AbstractMap
    implements XSNamedMap
    Contains the map between qnames and XSObject's.
    Version:
    $Id$
    Author:
    Sandy Gao, IBM, Michael Glavassevich, IBM
    • Field Detail

      • EMPTY_MAP

        public static final XSNamedMapImpl EMPTY_MAP
        An immutable empty map.
    • Constructor Detail

      • XSNamedMapImpl

        public XSNamedMapImpl​(String namespace,
                              SymbolHash map)
        Construct an XSNamedMap implementation for one namespace
        Parameters:
        namespace - the namespace to which the components belong
        map - the map from local names to components
      • XSNamedMapImpl

        public XSNamedMapImpl​(String[] namespaces,
                              SymbolHash[] maps,
                              int num)
        Construct an XSNamedMap implementation for a list of namespaces
        Parameters:
        namespaces - the namespaces to which the components belong
        maps - the maps from local names to components
        num - the number of namespaces
      • XSNamedMapImpl

        public XSNamedMapImpl​(XSObject[] array,
                              int length)
        Construct an XSNamedMap implementation one namespace from an array
        Parameters:
        array - containing all components
        length - number of components
    • Method Detail

      • getLength

        public int getLength()
        The number of XSObjects in the XSObjectList. The range of valid child object indices is 0 to length-1 inclusive.
        Specified by:
        getLength in interface XSNamedMap
      • itemByName

        public XSObject itemByName​(String namespace,
                                   String localName)
        Retrieves an XSObject specified by local name and namespace URI.
        Per XML Namespaces, applications must use the value null as the namespace parameter for methods if they wish to specify no namespace.
        Specified by:
        itemByName in interface XSNamedMap
        Parameters:
        namespace - The namespace URI of the XSObject to retrieve, or null if the XSObject has no namespace.
        localName - The local name of the XSObject to retrieve.
        Returns:
        A XSObject (of any type) with the specified local name and namespace URI, or null if they do not identify any object in this map.
      • item

        public XSObject item​(int index)
        Returns the indexth item in the collection or null if index is greater than or equal to the number of objects in the list. The index starts at 0.
        Specified by:
        item in interface XSNamedMap
        Parameters:
        index - index into the collection.
        Returns:
        The XSObject at the indexth position in the XSObjectList, or null if the index specified is not valid.