Package 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.INTERNAL:
- Usage of this class is not supported. It may be altered or removed at any time.
- Version:
- $Id: XSNamedMapImpl.java 965315 2010-07-18 23:06:35Z mrglavas $
- Author:
- Sandy Gao, IBM, Michael Glavassevich, IBM
-
-
Field Summary
Fields Modifier and Type Field Description static XSNamedMapImpl
EMPTY_MAP
An immutable empty map.
-
Constructor Summary
Constructors Constructor Description XSNamedMapImpl(java.lang.String[] namespaces, SymbolHash[] maps, int num)
Construct an XSNamedMap implementation for a list of namespacesXSNamedMapImpl(java.lang.String namespace, SymbolHash map)
Construct an XSNamedMap implementation for one namespaceXSNamedMapImpl(org.apache.xerces.xs.XSObject[] array, int length)
Construct an XSNamedMap implementation one namespace from an array
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(java.lang.Object key)
java.util.Set
entrySet()
java.lang.Object
get(java.lang.Object key)
int
getLength()
The number ofXSObjects
in theXSObjectList
.org.apache.xerces.xs.XSObject
item(int index)
Returns theindex
th item in the collection ornull
ifindex
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 anXSObject
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
-
-
-
-
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 belongmap
- 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 belongmaps
- the maps from local names to componentsnum
- 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 componentslength
- number of components
-
-
Method Detail
-
getLength
public int getLength()
The number ofXSObjects
in theXSObjectList
. The range of valid child object indices is 0 tolength-1
inclusive.- Specified by:
getLength
in interfaceorg.apache.xerces.xs.XSNamedMap
-
itemByName
public org.apache.xerces.xs.XSObject itemByName(java.lang.String namespace, java.lang.String localName)
Retrieves anXSObject
specified by local name and namespace URI.
Per XML Namespaces, applications must use the valuenull
as thenamespace
parameter for methods if they wish to specify no namespace.- Specified by:
itemByName
in interfaceorg.apache.xerces.xs.XSNamedMap
- Parameters:
namespace
- The namespace URI of theXSObject
to retrieve, ornull
if theXSObject
has no namespace.localName
- The local name of theXSObject
to retrieve.- Returns:
- A
XSObject
(of any type) with the specified local name and namespace URI, ornull
if they do not identify any object in this map.
-
item
public org.apache.xerces.xs.XSObject item(int index)
Returns theindex
th item in the collection ornull
ifindex
is greater than or equal to the number of objects in the list. The index starts at 0.- Specified by:
item
in interfaceorg.apache.xerces.xs.XSNamedMap
- Parameters:
index
- index into the collection.- Returns:
- The
XSObject
at theindex
th position in theXSObjectList
, ornull
if the index specified is not valid.
-
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKey
in interfacejava.util.Map
- Overrides:
containsKey
in classjava.util.AbstractMap
-
get
public java.lang.Object get(java.lang.Object key)
- Specified by:
get
in interfacejava.util.Map
- Overrides:
get
in classjava.util.AbstractMap
-
size
public int size()
- Specified by:
size
in interfacejava.util.Map
- Overrides:
size
in classjava.util.AbstractMap
-
entrySet
public java.util.Set entrySet()
- Specified by:
entrySet
in interfacejava.util.Map
- Specified by:
entrySet
in classjava.util.AbstractMap
-
-