FileDocCategorySizeDatePackage
MockNamedNodeMap.javaAPI DocAndroid 1.5 API3119Wed May 06 22:41:10 BST 2009com.android.ide.eclipse.editors.mock

MockNamedNodeMap

public class MockNamedNodeMap extends Object implements NamedNodeMap

Fields Summary
private final HashMap
mNodeMap
map for access by namespace/name
private final ArrayList
mNodeList
list for access by index
Constructors Summary
Methods Summary
public MockXmlNodeaddAttribute(java.lang.String namespace, java.lang.String localName, java.lang.String value)

     
            
        MockXmlNode node = new MockXmlNode(namespace, localName, value);

        if (namespace == null) {
            namespace = ""; // no namespace
        }
        
        // get the map for the namespace
        HashMap<String, Node> map = mNodeMap.get(namespace);
        if (map == null) {
            map = new HashMap<String, Node>();
            mNodeMap.put(namespace, map);
        }
        
        
        map.put(localName, node);
        mNodeList.add(node);
        
        return node;
    
public intgetLength()

        return mNodeList.size();
    
public org.w3c.dom.NodegetNamedItem(java.lang.String name)

        HashMap<String, Node> map = mNodeMap.get(""); // no namespace
        if (map != null) {
            return map.get(name);
        }
        
        return null;
    
public org.w3c.dom.NodegetNamedItemNS(java.lang.String namespaceURI, java.lang.String localName)

        if (namespaceURI == null) {
            namespaceURI = ""; //no namespace
        }
        
        HashMap<String, Node> map = mNodeMap.get(namespaceURI);
        if (map != null) {
            return map.get(localName);
        }
        
        return null;
    
public org.w3c.dom.Nodeitem(int index)

        return mNodeList.get(index);
    
public org.w3c.dom.NoderemoveNamedItem(java.lang.String name)

        throw new NotImplementedException();
    
public org.w3c.dom.NoderemoveNamedItemNS(java.lang.String namespaceURI, java.lang.String localName)

        throw new NotImplementedException();
    
public org.w3c.dom.NodesetNamedItem(org.w3c.dom.Node arg)

        throw new NotImplementedException();
    
public org.w3c.dom.NodesetNamedItemNS(org.w3c.dom.Node arg)

        throw new NotImplementedException();