Class XSNamedMapImpl
- java.lang.Object
-
- java.util.AbstractMap
-
- org.smooks.engine.delivery.sax.ng.org.apache.xerces.impl.xs.util.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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description static XSNamedMapImpl
EMPTY_MAP
An immutable empty map.
-
Constructor Summary
Constructors Constructor Description XSNamedMapImpl(String[] namespaces, SymbolHash[] maps, int num)
Construct an XSNamedMap implementation for a list of namespacesXSNamedMapImpl(String namespace, SymbolHash map)
Construct an XSNamedMap implementation for one namespaceXSNamedMapImpl(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(Object key)
Set
entrySet()
Object
get(Object key)
int
getLength()
The number ofXSObjects
in theXSObjectList
.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.XSObject
itemByName(String namespace, 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
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsValue, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, values
-
-
-
-
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 belongmap
- 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 belongmaps
- the maps from local names to componentsnum
- the number of namespaces
-
XSNamedMapImpl
public XSNamedMapImpl(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 interfaceXSNamedMap
-
itemByName
public XSObject itemByName(String namespace, 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 interfaceXSNamedMap
- 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 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 interfaceXSNamedMap
- 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(Object key)
- Specified by:
containsKey
in interfaceMap
- Overrides:
containsKey
in classAbstractMap
-
get
public Object get(Object key)
- Specified by:
get
in interfaceMap
- Overrides:
get
in classAbstractMap
-
size
public int size()
- Specified by:
size
in interfaceMap
- Overrides:
size
in classAbstractMap
-
entrySet
public Set entrySet()
- Specified by:
entrySet
in interfaceMap
- Specified by:
entrySet
in classAbstractMap
-
-