com.sun.xml.ws.util
Class QNameMap<V>

java.lang.Object
  extended by com.sun.xml.ws.util.QNameMap<V>

public final class QNameMap<V>
extends java.lang.Object

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
static class QNameMap.Entry<V>
           
 
Constructor Summary
QNameMap()
           
 
Method Summary
 boolean containsKey(java.lang.String nsUri, java.lang.String localName)
           
 java.util.Set<QNameMap.Entry<V>> entrySet()
           
 V get(javax.xml.namespace.QName name)
           
 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.
 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(javax.xml.namespace.QName 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.
 QNameMap<V> putAll(java.util.Map<javax.xml.namespace.QName,? extends V> map)
           
 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()
           
 java.lang.Iterable<V> values()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QNameMap

public QNameMap()
Method Detail

put

public void put(java.lang.String namespaceUri,
                java.lang.String localname,
                V value)
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

public void put(javax.xml.namespace.QName name,
                V value)

get

public V get(@NotNull
             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.

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 null if the map contains no mapping for this set of keys.
See Also:
put(String,String, Object)

get

public V get(javax.xml.namespace.QName name)

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

public 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.

Parameters:
map - mappings to be stored in this map.

putAll

public QNameMap<V> putAll(java.util.Map<javax.xml.namespace.QName,? extends V> map)

getOne

public QNameMap.Entry<V> 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

public java.util.Collection<javax.xml.namespace.QName> keySet()

values

public java.lang.Iterable<V> values()

containsKey

public boolean containsKey(@NotNull
                           java.lang.String nsUri,
                           java.lang.String localName)

isEmpty

public boolean isEmpty()
Returns true if this map is empty.


entrySet

public java.util.Set<QNameMap.Entry<V>> entrySet()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.