Top Description Inners Fields Constructors Methods
com.sun.org.apache.xerces.internal.impl.xs.util

public Class XSNamedMapImpl

extends AbstractMap<QName, XSObject>
implements XSNamedMap
Class Inheritance
All Implemented Interfaces
com.sun.org.apache.xerces.internal.xs.XSNamedMap, java.util.Map
Known Direct Subclasses
com.sun.org.apache.xerces.internal.impl.xs.util.XSNamedMap4Types
Imports
com.sun.org.apache.xerces.internal.util.SymbolHash, com.sun.org.apache.xerces.internal.xs.XSNamedMap, .XSObject, java.util.AbstractMap, .AbstractSet, .Iterator, .Map, .NoSuchElementException, .Set, javax.xml.XMLConstants, javax.xml.namespace.QName

Containts the map between qnames and XSObject's.
Author
Sandy Gao, IBM

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
XSNamedMapImpl.XSNamedMapEntry

An entry in the XSNamedMap.

Field Summary

Modifier and TypeField and Description
public static final XSNamedMapImpl
EMPTY_MAP

An immutable empty map.

pack-priv XSObject[]
private Set<Map.Entry<QName, XSObject>>
pack-priv int
pack-priv final SymbolHash[]
pack-priv final String[]
pack-priv final int

Constructor Summary

AccessConstructor and Description
public
XSNamedMapImpl(String
the namespace to which the components belong
namespace
,
SymbolHash
the map from local names to components
map
)

Construct an XSNamedMap implementation for one namespace

public
XSNamedMapImpl(String[]
the namespaces to which the components belong
namespaces
,
SymbolHash[]
the maps from local names to components
maps
,
int
the number of namespaces
num
)

Construct an XSNamedMap implementation for a list of namespaces

public
XSNamedMapImpl(XSObject[]
containing all components
array
,
int
number of components
length
)

Construct an XSNamedMap implementation one namespace from an array

Method Summary

Modifier and TypeMethod and Description
public boolean
containsKey(Object
key whose presence in this map is to be tested
key
)

Overrides java.util.AbstractMap.containsKey.

Implements java.util.Map.containsKey.

Returns true if this map contains a mapping for the specified key.

public synchronized Set<Map.Entry<QName, XSObject>>
entrySet()

Implements abstract java.util.AbstractMap.entrySet.

Implements java.util.Map.entrySet.

Returns a Set view of the mappings contained in this map.

public XSObject
get(Object
the key whose associated value is to be returned
key
)

Overrides java.util.AbstractMap.get.

Implements java.util.Map.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

public synchronized int
getLength()

Implements com.sun.org.apache.xerces.internal.xs.XSNamedMap.getLength.

The number of XSObjects in the XSObjectList.

pack-priv static boolean
isEqual(String one, String two)

public synchronized XSObject

Returns:

The XSObject at the indexth position in the XSObjectList, or null if the index specified is not valid.
item
(int
index into the collection.
index
)

Implements com.sun.org.apache.xerces.internal.xs.XSNamedMap.item.

Returns the indexth item in the collection or null if index is greater than or equal to the number of objects in the list.

public XSObject

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.
itemByName
(String
The namespace URI of the XSObject to retrieve, or null if the XSObject has no namespace.
namespace
,
String
The local name of the XSObject to retrieve.
localName
)

Implements com.sun.org.apache.xerces.internal.xs.XSNamedMap.itemByName.

Retrieves an XSObject specified by local name and namespace URI.

public int
size()

Overrides java.util.AbstractMap.size.

Implements java.util.Map.size.

Returns the number of key-value mappings in this map.

Inherited from java.util.AbstractMap:
clearclonecontainsValueequalshashCodeisEmptykeySetputputAllremovetoStringvalues

Field Detail

EMPTY_MAPback to summary
public static final XSNamedMapImpl EMPTY_MAP

An immutable empty map.

fArrayback to summary
pack-priv XSObject[] fArray
fEntrySetback to summary
private Set<Map.Entry<QName, XSObject>> fEntrySet
fLengthback to summary
pack-priv int fLength
fMapsback to summary
pack-priv final SymbolHash[] fMaps
fNamespacesback to summary
pack-priv final String[] fNamespaces
fNSNumback to summary
pack-priv final int fNSNum

Constructor Detail

XSNamedMapImplback to summary
public XSNamedMapImpl(String namespace, SymbolHash map)

Construct an XSNamedMap implementation for one namespace

Parameters
namespace:String

the namespace to which the components belong

map:SymbolHash

the map from local names to components

XSNamedMapImplback to summary
public XSNamedMapImpl(String[] namespaces, SymbolHash[] maps, int num)

Construct an XSNamedMap implementation for a list of namespaces

Parameters
namespaces:String[]

the namespaces to which the components belong

maps:SymbolHash[]

the maps from local names to components

num:int

the number of namespaces

XSNamedMapImplback to summary
public XSNamedMapImpl(XSObject[] array, int length)

Construct an XSNamedMap implementation one namespace from an array

Parameters
array:XSObject[]

containing all components

length:int

number of components

Method Detail

containsKeyback to summary
public boolean containsKey(Object key)

Overrides java.util.AbstractMap.containsKey.

Implements java.util.Map.containsKey.

Doc from java.util.Map.containsKey.

Returns true if this map contains a mapping for the specified key. More formally, returns true if and only if this map contains a mapping for a key k such that Objects.equals(key, k). (There can be at most one such mapping.)

Parameters
key:Object

key whose presence in this map is to be tested

Returns:boolean

true if this map contains a mapping for the specified key

entrySetback to summary
public synchronized Set<Map.Entry<QName, XSObject>> entrySet()

Implements abstract java.util.AbstractMap.entrySet.

Implements java.util.Map.entrySet.

Doc from java.util.Map.entrySet.

Returns a Set view of the mappings contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation, or through the setValue operation on a map entry returned by the iterator) the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

Returns:Set<Map.Entry<QName, XSObject>>

a set view of the mappings contained in this map

getback to summary
public XSObject get(Object key)

Overrides java.util.AbstractMap.get.

Implements java.util.Map.get.

Doc from java.util.Map.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

More formally, if this map contains a mapping from a key k to a value v such that Objects.equals(key, k), then this method returns v; otherwise it returns null. (There can be at most one such mapping.)

If this map permits null values, then a return value of null does not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases.

Parameters
key:Object

the key whose associated value is to be returned

Returns:XSObject

the value to which the specified key is mapped, or null if this map contains no mapping for the key

getLengthback to summary
public synchronized int getLength()

Implements com.sun.org.apache.xerces.internal.xs.XSNamedMap.getLength.

The number of XSObjects in the XSObjectList. The range of valid child object indices is 0 to length-1 inclusive.

isEqualback to summary
pack-priv static boolean isEqual(String one, String two)
itemback to summary
public synchronized XSObject item(int index)

Implements com.sun.org.apache.xerces.internal.xs.XSNamedMap.item.

Returns the indexth 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.

Parameters
index:int

index into the collection.

Returns:XSObject

The XSObject at the indexth position in the XSObjectList, or null if the index specified is not valid.

itemByNameback to summary
public XSObject itemByName(String namespace, String localName)

Implements com.sun.org.apache.xerces.internal.xs.XSNamedMap.itemByName.

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.

Parameters
namespace:String

The namespace URI of the XSObject to retrieve, or null if the XSObject has no namespace.

localName:String

The local name of the XSObject to retrieve.

Returns:XSObject

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.

sizeback to summary
public int size()

Overrides java.util.AbstractMap.size.

Implements java.util.Map.size.

Doc from java.util.Map.size.

Returns the number of key-value mappings in this map. If the map contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of key-value mappings in this map

com.sun.org.apache.xerces.internal.impl.xs.util back to summary

private final Class XSNamedMapImpl.XSNamedMapEntry

extends Object
implements Map.Entry<QName, XSObject>
Class Inheritance
  • java.lang.Object
  • com.sun.org.apache.xerces.internal.impl.xs.util.XSNamedMapImpl.XSNamedMapEntry
All Implemented Interfaces
java.util.Map.Entry

An entry in the XSNamedMap.

Field Summary

Modifier and TypeField and Description
private final QName
private final XSObject

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
public QName
getKey()

Implements java.util.Map.Entry.getKey.

Returns the key corresponding to this entry.

public XSObject
getValue()

Implements java.util.Map.Entry.getValue.

Returns the value corresponding to this entry.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Implements java.util.Map.Entry.hashCode.

Returns the hash code value for this map entry.

public XSObject
setValue(XSObject
new value to be stored in this entry
value
)

Implements java.util.Map.Entry.setValue.

Replaces the value corresponding to this entry with the specified value (optional operation).

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

keyback to summary
private final QName key
valueback to summary
private final XSObject value

Constructor Detail

XSNamedMapEntryback to summary
public XSNamedMapEntry(QName key, XSObject value)

Method Detail

equalsback to summary
public boolean equals(XSNamedMapImpl.XSNamedMapEntry o)
getKeyback to summary
public QName getKey()

Implements java.util.Map.Entry.getKey.

Doc from java.util.Map.Entry.getKey.

Returns the key corresponding to this entry.

Returns:QName

the key corresponding to this entry

getValueback to summary
public XSObject getValue()

Implements java.util.Map.Entry.getValue.

Doc from java.util.Map.Entry.getValue.

Returns the value corresponding to this entry. If the mapping has been removed from the backing map (by the iterator's remove operation), the results of this call are undefined.

Returns:XSObject

the value corresponding to this entry

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements java.util.Map.Entry.hashCode.

Doc from java.util.Map.Entry.hashCode.

Returns the hash code value for this map entry. The hash code of a map entry e is defined to be:

    (e.getKey()==null   ? 0 : e.getKey().hashCode()) ^
    (e.getValue()==null ? 0 : e.getValue().hashCode())
This ensures that e1.equals(e2) implies that e1.hashCode()==e2.hashCode() for any two Entries e1 and e2, as required by the general contract of Object.hashCode.
Returns:int

the hash code value for this map entry

setValueback to summary
public XSObject setValue(XSObject value)

Implements java.util.Map.Entry.setValue.

Doc from java.util.Map.Entry.setValue.

Replaces the value corresponding to this entry with the specified value (optional operation). (Writes through to the map.) The behavior of this call is undefined if the mapping has already been removed from the map (by the iterator's remove operation).

Parameters
value:XSObject

new value to be stored in this entry

Returns:XSObject

old value corresponding to the entry

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object