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 XSNamedMapImplEMPTY_MAPAn 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 booleancontainsKey(Object key)SetentrySet()Objectget(Object key)intgetLength()The number ofXSObjectsin theXSObjectList.XSObjectitem(int index)Returns theindexth item in the collection ornullifindexis greater than or equal to the number of objects in the list.XSObjectitemByName(String namespace, String localName)Retrieves anXSObjectspecified by local name and namespace URI.intsize()-
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 ofXSObjectsin theXSObjectList. The range of valid child object indices is 0 tolength-1inclusive.- Specified by:
getLengthin interfaceXSNamedMap
-
itemByName
public XSObject itemByName(String namespace, String localName)
Retrieves anXSObjectspecified by local name and namespace URI.
Per XML Namespaces, applications must use the valuenullas thenamespaceparameter for methods if they wish to specify no namespace.- Specified by:
itemByNamein interfaceXSNamedMap- Parameters:
namespace- The namespace URI of theXSObjectto retrieve, ornullif theXSObjecthas no namespace.localName- The local name of theXSObjectto retrieve.- Returns:
- A
XSObject(of any type) with the specified local name and namespace URI, ornullif they do not identify any object in this map.
-
item
public XSObject item(int index)
Returns theindexth item in the collection ornullifindexis greater than or equal to the number of objects in the list. The index starts at 0.- Specified by:
itemin interfaceXSNamedMap- Parameters:
index- index into the collection.- Returns:
- The
XSObjectat theindexth position in theXSObjectList, ornullif the index specified is not valid.
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfaceMap- Overrides:
containsKeyin classAbstractMap
-
get
public Object get(Object key)
- Specified by:
getin interfaceMap- Overrides:
getin classAbstractMap
-
size
public int size()
- Specified by:
sizein interfaceMap- Overrides:
sizein classAbstractMap
-
entrySet
public Set entrySet()
- Specified by:
entrySetin interfaceMap- Specified by:
entrySetin classAbstractMap
-
-