org.apache.xerces.impl.xs.util

## Class XSNamedMap4Types

- java.lang.Object
- - java.util.AbstractMap
  - - org.apache.xerces.impl.xs.util.XSNamedMapImpl
    - - org.apache.xerces.impl.xs.util.XSNamedMap4Types

- All Implemented Interfaces:
    java.util.Map, org.apache.xerces.xs.XSNamedMap

      public final class XSNamedMap4Types
      extends XSNamedMapImpl

  Contains the map between qnames and XSObject's.
  Version:
    $Id: XSNamedMap4Types.java 726360 2008-12-14 05:04:38Z mrglavas $
  Author:
    Sandy Gao, IBM

  # INTERNAL:

    Usage of this class is not supported. It may be altered or removed at any time.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.util.AbstractMap

      `java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>`

    - ### Nested classes/interfaces inherited from interface java.util.Map

      `java.util.Map.Entry<K,V>`

  - ### Field Summary

    - ### Fields inherited from class org.apache.xerces.impl.xs.util.XSNamedMapImpl

      `EMPTY_MAP`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XSNamedMap4Types(java.lang.String[] namespaces, SymbolHash[] maps, int num, short type)` Construct an XSNamedMap implementation for a list of namespaces
    `XSNamedMap4Types(java.lang.String namespace, SymbolHash map, short type)` Construct an XSNamedMap implementation for one namespace

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getLength()` The number of `XSObjects` in the `XSObjectList`.
    `org.apache.xerces.xs.XSObject` | `item(int index)` Returns the `index`th item in the map.
    `org.apache.xerces.xs.XSObject` | `itemByName(java.lang.String namespace, java.lang.String localName)` Retrieves an `XSObject` specified by local name and namespace URI.

    - ### Methods inherited from class org.apache.xerces.impl.xs.util.XSNamedMapImpl

      `containsKey, entrySet, get, size`

    - ### Methods inherited from class java.util.AbstractMap

      `clear, clone, containsValue, equals, hashCode, isEmpty, keySet, put, putAll, remove, toString, values`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Map

      `clear, containsValue, equals, hashCode, isEmpty, keySet, put, putAll, remove, values`

- - ### Constructor Detail

    - #### XSNamedMap4Types

          public XSNamedMap4Types(java.lang.String namespace,
                          SymbolHash map,
                          short type)

      Construct an XSNamedMap implementation for one namespace
      Parameters:
        `namespace` - the namespace to which the components belong
        `map` - the map from local names to components
        `type` - the type of components

    - #### XSNamedMap4Types

          public XSNamedMap4Types(java.lang.String[] namespaces,
                          SymbolHash[] maps,
                          int num,
                          short type)

      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
        `type` - the type of components

  - ### Method Detail

    - #### getLength

          public int getLength()

      The number of `XSObjects` in the `XSObjectList`. The range of valid child node indices is 0 to `length-1` inclusive.
      Specified by:
        `getLength` in interface `org.apache.xerces.xs.XSNamedMap`
      Overrides:
        `getLength` in class `XSNamedMapImpl`

    - #### itemByName

          public org.apache.xerces.xs.XSObject itemByName(java.lang.String namespace,
                                                 java.lang.String localName)

      Retrieves an `XSObject` specified by local name and namespace URI.
      Specified by:
        `itemByName` in interface `org.apache.xerces.xs.XSNamedMap`
      Overrides:
        `itemByName` in class `XSNamedMapImpl`
      Parameters:
        `namespace` - The namespace URI of the `XSObject` to retrieve.
        `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 `XSObject` in this map.

    - #### item

          public org.apache.xerces.xs.XSObject item(int index)

      Returns the `index`th item in the map. The index starts at 0. If `index` is greater than or equal to the number of nodes in the list, this returns `null`.
      Specified by:
        `item` in interface `org.apache.xerces.xs.XSNamedMap`
      Overrides:
        `item` in class `XSNamedMapImpl`
      Parameters:
        `index` - The position in the map from which the item is to be retrieved.
      Returns:
        The `XSObject` at the `index`th position in the `XSNamedMap`, or `null` if that is not a valid index.

Copyright © 1999-2022 The Apache Software Foundation. All Rights Reserved.