public final class QNameMap<V>
extends java.lang.Object
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 intern
ed.Modifier and Type | Class | Description |
---|---|---|
static class |
QNameMap.Entry<V> |
Constructor | Description |
---|---|
QNameMap() |
Modifier and Type | Method | Description |
---|---|---|
boolean |
containsKey(java.lang.String nsUri,
java.lang.String localName) |
|
java.util.Set<QNameMap.Entry<V>> |
entrySet() |
|
V |
get(java.lang.String nsUri,
java.lang.String localPart) |
Returns the value to which the specified keys are mapped in this QNameMap,
or
null if the map contains no mapping for this key. |
V |
get(javax.xml.namespace.QName name) |
|
QNameMap.Entry<V> |
getOne() |
Returns one random item in the map.
|
boolean |
isEmpty() |
Returns true if this map is empty.
|
java.util.Collection<javax.xml.namespace.QName> |
keySet() |
|
void |
put(Name name,
V value) |
|
void |
put(java.lang.String namespaceUri,
java.lang.String localname,
V value) |
Associates the specified value with the specified keys in this map.
|
void |
put(javax.xml.namespace.QName name,
V value) |
|
QNameMap<V> |
putAll(QNameMap<? extends V> map) |
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.
|
int |
size() |
Returns the number of keys-value mappings in this map.
|
java.lang.String |
toString() |
public void put(java.lang.String namespaceUri, java.lang.String localname, V value)
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.public void put(javax.xml.namespace.QName name, V value)
public V get(java.lang.String nsUri, java.lang.String localPart)
null
if the map contains no mapping for this key.nsUri
- the namespaceUri key whose associated value is to be returned.localPart
- the localPart key whose associated value is to be returned.null
if the map contains no mapping for this set of keys.put(String,String, Object)
public V get(javax.xml.namespace.QName name)
public int size()
public QNameMap<V> putAll(QNameMap<? extends V> map)
map
- mappings to be stored in this map.public QNameMap.Entry<V> getOne()
This method is useful to obtain the value from a map that only contains one element.
public java.util.Collection<javax.xml.namespace.QName> keySet()
public boolean containsKey(java.lang.String nsUri, java.lang.String localName)
public boolean isEmpty()
public java.util.Set<QNameMap.Entry<V>> entrySet()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2018 Oracle Corporation. All rights reserved.