org.apache.xerces.impl.xs.util

## Class XSNamedMapImpl

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

- All Implemented Interfaces:
    java.util.Map, org.apache.xerces.xs.XSNamedMap
  Direct Known Subclasses:
    XSNamedMap4Types

      public class XSNamedMapImpl
      extends java.util.AbstractMap
      implements org.apache.xerces.xs.XSNamedMap

  Contains the map between qnames and XSObject's.
  Version:
    $Id: XSNamedMapImpl.java 965316 2010-07-18 23:07:03Z mrglavas $
  Author:
    Sandy Gao, IBM, Michael Glavassevich, 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
    Modifier and Type | Field and Description
    --- | ---
    `static XSNamedMapImpl` | `EMPTY_MAP` An immutable empty map.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XSNamedMapImpl(java.lang.String[] namespaces, SymbolHash[] maps, int num)` Construct an XSNamedMap implementation for a list of namespaces
    `XSNamedMapImpl(java.lang.String namespace, SymbolHash map)` Construct an XSNamedMap implementation for one namespace
    `XSNamedMapImpl(org.apache.xerces.xs.XSObject[] array, int length)` Construct an XSNamedMap implementation one namespace from an array

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `containsKey(java.lang.Object key)`
    `java.util.Set` | `entrySet()`
    `java.lang.Object` | `get(java.lang.Object key)`
    `int` | `getLength()` The number of `XSObjects` in the `XSObjectList`.
    `org.apache.xerces.xs.XSObject` | `item(int index)` Returns the `index`th item in the collection or `null` if `index` is greater than or equal to the number of objects in the list.
    `org.apache.xerces.xs.XSObject` | `itemByName(java.lang.String namespace, java.lang.String localName)` Retrieves an `XSObject` specified by local name and namespace URI.
    `int` | `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`

- - ### Field Detail

    - #### EMPTY_MAP

          public static final XSNamedMapImpl EMPTY_MAP

      An immutable empty map.

  - ### Constructor Detail

    - #### XSNamedMapImpl

          public XSNamedMapImpl(java.lang.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(java.lang.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(org.apache.xerces.xs.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 `org.apache.xerces.xs.XSNamedMap`

    - #### 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.
      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 `org.apache.xerces.xs.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 org.apache.xerces.xs.XSObject item(int index)

      Returns the `index`th 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 `org.apache.xerces.xs.XSNamedMap`
      Parameters:
        `index` - index into the collection.
      Returns:
        The `XSObject` at the `index`th position in the `XSObjectList`, or `null` if the index specified is not valid.

    - #### containsKey

          public boolean containsKey(java.lang.Object key)

      Specified by:
        `containsKey` in interface `java.util.Map`
      Overrides:
        `containsKey` in class `java.util.AbstractMap`

    - #### get

          public java.lang.Object get(java.lang.Object key)

      Specified by:
        `get` in interface `java.util.Map`
      Overrides:
        `get` in class `java.util.AbstractMap`

    - #### size

          public int size()

      Specified by:
        `size` in interface `java.util.Map`
      Overrides:
        `size` in class `java.util.AbstractMap`

    - #### entrySet

          public java.util.Set entrySet()

      Specified by:
        `entrySet` in interface `java.util.Map`
      Specified by:
        `entrySet` in class `java.util.AbstractMap`

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