Package com.sun.xml.bind.v2.util
Class QNameMap<V>
java.lang.Object
com.sun.xml.bind.v2.util.QNameMap<V>
Map keyed by
QName.
This specialized map allows a look up operation without constructing
a new QName instance, for a performance reason. This Map assumes
that both namespace URI and local name are interned.- Since:
- JAXB 2.0
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(String nsUri, String localName) entrySet()Returns the value to which the specified keys are mapped in this QNameMap, ornullif the map contains no mapping for this key.getOne()Returns one random item in the map.booleanisEmpty()Returns true if this map is empty.keySet()voidvoidAssociates the specified value with the specified keys in this map.voidCopies all of the mappings from the specified map to this map These mappings will replace any mappings that this map had for any of the keys currently in the specified map.intsize()Returns the number of keys-value mappings in this map.toString()
-
Constructor Details
-
QNameMap
public QNameMap()
-
-
Method Details
-
put
Associates the specified value with the specified keys in this map. If the map previously contained a mapping for this key, the old value is replaced.- Parameters:
namespaceUri- First key with which the specified value is to be associated.localname- Second key with which the specified value is to be associated.value- value to be associated with the specified key.
-
put
-
put
-
get
Returns the value to which the specified keys are mapped in this QNameMap, ornullif the map contains no mapping for this key.- Parameters:
nsUri- the namespaceUri key whose associated value is to be returned.localPart- the localPart key whose associated value is to be returned.- Returns:
- the value to which this map maps the specified set of keya, or
nullif the map contains no mapping for this set of keys. - See Also:
-
get
-
size
public int size()Returns the number of keys-value mappings in this map.- Returns:
- the number of keys-value mappings in this map.
-
putAll
Copies all of the mappings from the specified map to this map These mappings will replace any mappings that this map had for any of the keys currently in the specified map.- Parameters:
map- mappings to be stored in this map.
-
getOne
Returns one random item in the map. If this map is empty, return null.This method is useful to obtain the value from a map that only contains one element.
-
keySet
-
containsKey
-
isEmpty
public boolean isEmpty()Returns true if this map is empty. -
entrySet
-
toString
-