< prev index next >

src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/util/QNameMap.java

Print this page




 118             if (e.hash == hash && localname == e.localName && namespaceUri==e.nsUri) {
 119                 e.value = value;
 120                 return;
 121             }
 122         }
 123 
 124         addEntry(hash, namespaceUri,localname, value, i);
 125 
 126     }
 127 
 128     public void put(QName name, V value ) {
 129         put(name.getNamespaceURI(),name.getLocalPart(),value);
 130     }
 131 
 132     public void put(Name name, V value ) {
 133         put(name.nsUri,name.localName,value);
 134     }
 135 
 136     /**
 137      * Returns the value to which the specified keys are mapped in this QNameMap,
 138      * or <tt>null</tt> if the map contains no mapping for this key.
 139      *
 140      * @param   nsUri the namespaceUri key whose associated value is to be returned.
 141      * @param   localPart the localPart key whose associated value is to be returned.
 142      * @return  the value to which this map maps the specified set of keya, or
 143      *          <tt>null</tt> if the map contains no mapping for this set of keys.
 144      * @see #put(String,String, Object)
 145      */
 146     public V get( String nsUri, String localPart ) {
 147         Entry<V> e = getEntry(nsUri,localPart);
 148         if(e==null) return null;
 149         else        return e.value;
 150         }
 151 
 152     public V get( QName name ) {
 153         return get(name.getNamespaceURI(),name.getLocalPart());
 154     }
 155 
 156     /**
 157      * Returns the number of keys-value mappings in this map.
 158      *
 159      * @return the number of keys-value mappings in this map.
 160      */
 161     public int size() {
 162         return size;
 163     }




 118             if (e.hash == hash && localname == e.localName && namespaceUri==e.nsUri) {
 119                 e.value = value;
 120                 return;
 121             }
 122         }
 123 
 124         addEntry(hash, namespaceUri,localname, value, i);
 125 
 126     }
 127 
 128     public void put(QName name, V value ) {
 129         put(name.getNamespaceURI(),name.getLocalPart(),value);
 130     }
 131 
 132     public void put(Name name, V value ) {
 133         put(name.nsUri,name.localName,value);
 134     }
 135 
 136     /**
 137      * Returns the value to which the specified keys are mapped in this QNameMap,
 138      * or {@code null} if the map contains no mapping for this key.
 139      *
 140      * @param   nsUri the namespaceUri key whose associated value is to be returned.
 141      * @param   localPart the localPart key whose associated value is to be returned.
 142      * @return  the value to which this map maps the specified set of keya, or
 143      *          {@code null} if the map contains no mapping for this set of keys.
 144      * @see #put(String,String, Object)
 145      */
 146     public V get( String nsUri, String localPart ) {
 147         Entry<V> e = getEntry(nsUri,localPart);
 148         if(e==null) return null;
 149         else        return e.value;
 150         }
 151 
 152     public V get( QName name ) {
 153         return get(name.getNamespaceURI(),name.getLocalPart());
 154     }
 155 
 156     /**
 157      * Returns the number of keys-value mappings in this map.
 158      *
 159      * @return the number of keys-value mappings in this map.
 160      */
 161     public int size() {
 162         return size;
 163     }


< prev index next >