org.apache.batik.dom

Class AbstractElement.NamedNodeHashMap

public class AbstractElement.NamedNodeHashMap extends Object implements NamedNodeMap, Serializable

An implementation of the {@link org.w3c.dom.NamedNodeMap}.
This Map is not Thread-safe, concurrent updates or reading while updating may give unexpected results.
Field Summary
protected intcount
The number of entries
protected static intINITIAL_CAPACITY
The initial capacity
protected AbstractElement.Entry[]table
The underlying array
Constructor Summary
NamedNodeHashMap()
Creates a new NamedNodeHashMap object.
Method Summary
protected voidcheckNode(Node arg)
Checks the validity of a node to add.
protected Nodeget(String ns, String nm)
Gets the value of a variable
intgetLength()
DOM: Implements {@link org.w3c.dom.NamedNodeMap#getLength()}.
NodegetNamedItem(String name)
DOM: Implements {@link org.w3c.dom.NamedNodeMap#getNamedItem(String)}.
NodegetNamedItemNS(String namespaceURI, String localName)
DOM: Implements {@link org.w3c.dom.NamedNodeMap#getNamedItemNS(String,String)}.
protected inthashCode(String ns, String nm)
Computes a hash code corresponding to the given strings.
Nodeitem(int index)
DOM: Implements {@link org.w3c.dom.NamedNodeMap#item(int)}.
protected Nodeput(String ns, String nm, Node value)
Sets a new value for the given variable
protected voidrehash()
Rehash and grow the table.
protected Noderemove(String ns, String nm)
Removes an entry from the table.
NoderemoveNamedItem(String name)
DOM: Implements {@link org.w3c.dom.NamedNodeMap#removeNamedItem(String)}.
NoderemoveNamedItemNS(String namespaceURI, String localName)
DOM: Implements {@link org.w3c.dom.NamedNodeMap#removeNamedItemNS(String,String)}.
NodesetNamedItem(Node arg)
DOM: Implements {@link org.w3c.dom.NamedNodeMap#setNamedItem(Node)}.
NodesetNamedItem(String ns, String name, Node arg)
Adds a node to the map.
NodesetNamedItemNS(Node arg)
DOM: Implements {@link org.w3c.dom.NamedNodeMap#setNamedItemNS(Node)}.

Field Detail

count

protected int count
The number of entries

INITIAL_CAPACITY

protected static final int INITIAL_CAPACITY
The initial capacity

table

protected AbstractElement.Entry[] table
The underlying array

Constructor Detail

NamedNodeHashMap

public NamedNodeHashMap()
Creates a new NamedNodeHashMap object.

Method Detail

checkNode

protected void checkNode(Node arg)
Checks the validity of a node to add.

get

protected Node get(String ns, String nm)
Gets the value of a variable

Returns: the value or null

getLength

public int getLength()
DOM: Implements {@link org.w3c.dom.NamedNodeMap#getLength()}.

getNamedItem

public Node getNamedItem(String name)
DOM: Implements {@link org.w3c.dom.NamedNodeMap#getNamedItem(String)}.

getNamedItemNS

public Node getNamedItemNS(String namespaceURI, String localName)
DOM: Implements {@link org.w3c.dom.NamedNodeMap#getNamedItemNS(String,String)}.

hashCode

protected int hashCode(String ns, String nm)
Computes a hash code corresponding to the given strings.

item

public Node item(int index)
DOM: Implements {@link org.w3c.dom.NamedNodeMap#item(int)}.

put

protected Node put(String ns, String nm, Node value)
Sets a new value for the given variable

Returns: the old value or null

rehash

protected void rehash()
Rehash and grow the table.

remove

protected Node remove(String ns, String nm)
Removes an entry from the table.

Returns: the value or null.

removeNamedItem

public Node removeNamedItem(String name)
DOM: Implements {@link org.w3c.dom.NamedNodeMap#removeNamedItem(String)}.

removeNamedItemNS

public Node removeNamedItemNS(String namespaceURI, String localName)
DOM: Implements {@link org.w3c.dom.NamedNodeMap#removeNamedItemNS(String,String)}.

setNamedItem

public Node setNamedItem(Node arg)
DOM: Implements {@link org.w3c.dom.NamedNodeMap#setNamedItem(Node)}.

setNamedItem

public Node setNamedItem(String ns, String name, Node arg)
Adds a node to the map.

setNamedItemNS

public Node setNamedItemNS(Node arg)
DOM: Implements {@link org.w3c.dom.NamedNodeMap#setNamedItemNS(Node)}.
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.