org.apache.pivot.xml
Class Element.NamespaceDictionary

java.lang.Object
  extended by org.apache.pivot.xml.Element.NamespaceDictionary
All Implemented Interfaces:
Iterable<String>, Dictionary<String,String>
Enclosing class:
Element

public class Element.NamespaceDictionary
extends Object
implements Dictionary<String,String>, Iterable<String>

Dictionary representing the namespaces declared by this element.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.pivot.collections.Dictionary
Dictionary.Pair<K,V>
 
Method Summary
 boolean containsKey(String prefix)
          Tests for the existence of a namespace declared by this element.
 String get(String prefix)
          Returns the URI of a namespace declared by this element.
 Iterator<String> iterator()
          Returns an iterator over the element's namespace prefixes.
 String put(String prefix, String uri)
          Sets the URI of a namespace declared by this element.
 String remove(String prefix)
          Removes a namespace from this element's declared namespaces.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public String get(String prefix)
Returns the URI of a namespace declared by this element.

Specified by:
get in interface Dictionary<String,String>
Parameters:
prefix - The namespace prefix.
Returns:
The declared namespace, or null if no such namespace exists.

put

public String put(String prefix,
                  String uri)
Sets the URI of a namespace declared by this element.

Specified by:
put in interface Dictionary<String,String>
Parameters:
prefix - The namespace prefix.
uri - The namespace URI.
Returns:
The URI previously associated with the given prefix.

remove

public String remove(String prefix)
Removes a namespace from this element's declared namespaces.

Specified by:
remove in interface Dictionary<String,String>
Parameters:
prefix - The namespace prefix.
Returns:
The URI previously associated with the given prefix.

containsKey

public boolean containsKey(String prefix)
Tests for the existence of a namespace declared by this element.

Specified by:
containsKey in interface Dictionary<String,String>
Parameters:
prefix -
Returns:
true if this element declares a namespace with the given prefix; false, otherwise.

iterator

public Iterator<String> iterator()
Returns an iterator over the element's namespace prefixes.

Specified by:
iterator in interface Iterable<String>