org.dom4j.util

Class IndexedElement

Implemented Interfaces:
Branch, Cloneable, Branch, Element, Node, Serializable

public class IndexedElement
extends org.dom4j.tree.DefaultElement

IndexedElement is an implementation of Elementwhich maintains an index of the attributes and elements it contains to optimise lookups via name.
Version:
$Revision: 1.10 $
Author:
James Strachan

Field Summary

Fields inherited from class org.dom4j.tree.AbstractElement

EMPTY_ITERATOR, EMPTY_LIST, USE_STRINGVALUE_SEPARATOR, VERBOSE_TOSTRING

Fields inherited from class org.dom4j.tree.AbstractBranch

DEFAULT_CONTENT_LIST_SIZE

Fields inherited from class org.dom4j.tree.AbstractNode

NODE_TYPE_NAMES

Fields inherited from interface org.dom4j.Node

ANY_NODE, ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, MAX_NODE_TYPE, NAMESPACE_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE, UNKNOWN_NODE

Constructor Summary

IndexedElement(String name)
IndexedElement(QName qname)
IndexedElement(QName qname, int attributeCount)

Method Summary

protected void
addNode(Node node)
protected void
addToAttributeIndex(Object key, Attribute value)
protected void
addToAttributeIndex(Attribute attribute)
protected void
addToElementIndex(Object key, Element value)
protected void
addToElementIndex(Element element)
protected Element
asElement(Object object)
protected Iterator
asElementIterator(Object object)
Deprecated. WILL BE REMOVED IN dom4j-1.6 !!
protected List
asElementList(Object object)
Attribute
attribute(String name)
Attribute
attribute(QName qName)
protected Map
attributeIndex()
protected Map
createAttributeIndex()
A Factory Method to create the index for attributes
protected Map
createElementIndex()
A Factory Method to create the index for elements
protected Map
createIndex()
Factory method to return a new map implementation for indices
protected List
createList()
Factory method to return a list implementation for indices
Element
element(String name)
Element
element(QName qName)
protected Map
elementIndex()
List
elements(String name)
List
elements(QName qName)
protected void
removeFromAttributeIndex(Object key, Attribute value)
protected void
removeFromAttributeIndex(Attribute attribute)
protected void
removeFromElementIndex(Object key, Element value)
protected void
removeFromElementIndex(Element element)
protected boolean
removeNode(Node node)

Methods inherited from class org.dom4j.tree.DefaultElement

add, addNewNode, additionalNamespaces, additionalNamespaces, attribute, attribute, attribute, attribute, attributeCount, attributeIterator, attributeList, attributeList, attributes, clearContent, clone, contentList, declaredNamespaces, element, element, element, getDocument, getDocumentFactory, getNamespaceForPrefix, getNamespaceForURI, getParent, getQName, getStringValue, getText, indexOf, node, nodeCount, nodeIterator, processingInstruction, processingInstructions, processingInstructions, remove, removeNode, removeProcessingInstruction, setAttributeList, setAttributes, setContent, setDocument, setParent, setQName, supportsParent

Methods inherited from class org.dom4j.tree.AbstractElement

accept, add, add, add, add, add, add, add, add, add, addAttribute, addAttribute, addCDATA, addComment, addElement, addEntity, addNamespace, addNewNode, addNewNode, addNode, addNode, addProcessingInstruction, addProcessingInstruction, addText, additionalNamespaces, additionalNamespaces, appendAttributes, asXML, attribute, attribute, attribute, attribute, attributeCount, attributeIterator, attributeList, attributeList, attributeValue, attributeValue, attributeValue, attributeValue, attributes, childAdded, childRemoved, createAttributeList, createAttributeList, createCopy, createCopy, createCopy, createElement, createElement, createSingleIterator, declaredNamespaces, element, element, element, elementIterator, elementIterator, elementIterator, elementIterator, elementText, elementText, elementTextTrim, elementTextTrim, elements, elements, elements, elements, ensureAttributesCapacity, getData, getDocumentFactory, getName, getNamespace, getNamespaceForPrefix, getNamespaceForURI, getNamespacePrefix, getNamespaceURI, getNamespacesForURI, getNodeType, getPath, getQName, getQualifiedName, getStringValue, getUniquePath, getXPathNameStep, getXPathResult, hasMixedContent, indexOf, isRootElement, isTextOnly, node, nodeCount, nodeIterator, normalize, processingInstruction, processingInstructions, processingInstructions, remove, remove, remove, remove, remove, remove, remove, remove, remove, removeNode, removeProcessingInstruction, setAttributeValue, setAttributeValue, setAttributes, setData, setName, setNamespace, setText, toString, write

Methods inherited from class org.dom4j.tree.AbstractBranch

add, add, add, add, addElement, addElement, addElement, addElement, addNode, addNode, appendContent, childAdded, childRemoved, content, contentList, contentRemoved, createContentList, createContentList, createEmptyList, createResultList, createSingleResultList, elementByID, elementID, getContentAsStringValue, getContentAsText, getText, getTextTrim, hasContent, indexOf, invalidNodeTypeAddException, isReadOnly, node, nodeCount, nodeIterator, remove, remove, remove, remove, removeNode, setProcessingInstructions

Methods inherited from class org.dom4j.tree.AbstractNode

asXPathResult, clone, createPattern, createXPath, createXPathFilter, createXPathResult, detach, getDocument, getDocumentFactory, getName, getNodeType, getNodeTypeName, getParent, getPath, getStringValue, getText, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setName, setParent, setText, supportsParent, valueOf, write

Constructor Details

IndexedElement

public IndexedElement(String name)

IndexedElement

public IndexedElement(QName qname)

IndexedElement

public IndexedElement(QName qname,
                      int attributeCount)

Method Details

addNode

protected void addNode(Node node)
Overrides:
addNode in interface org.dom4j.tree.AbstractElement

addToAttributeIndex

protected void addToAttributeIndex(Object key,
                                   Attribute value)

addToAttributeIndex

protected void addToAttributeIndex(Attribute attribute)

addToElementIndex

protected void addToElementIndex(Object key,
                                 Element value)

addToElementIndex

protected void addToElementIndex(Element element)

asElement

protected Element asElement(Object object)

asElementIterator

protected Iterator asElementIterator(Object object)

Deprecated. WILL BE REMOVED IN dom4j-1.6 !!

DOCUMENT ME!
Parameters:
object - DOCUMENT ME!
Returns:
DOCUMENT ME!

asElementList

protected List asElementList(Object object)

attribute

public Attribute attribute(String name)
Specified by:
attribute in interface Element
Overrides:
attribute in interface org.dom4j.tree.DefaultElement

attribute

public Attribute attribute(QName qName)
Specified by:
attribute in interface Element
Overrides:
attribute in interface org.dom4j.tree.DefaultElement

attributeIndex

protected Map attributeIndex()

createAttributeIndex

protected Map createAttributeIndex()
A Factory Method to create the index for attributes
Returns:
DOCUMENT ME!

createElementIndex

protected Map createElementIndex()
A Factory Method to create the index for elements
Returns:
DOCUMENT ME!

createIndex

protected Map createIndex()
Factory method to return a new map implementation for indices
Returns:
DOCUMENT ME!

createList

protected List createList()
Factory method to return a list implementation for indices
Returns:
DOCUMENT ME!

element

public Element element(String name)
Specified by:
element in interface Element
Overrides:
element in interface org.dom4j.tree.DefaultElement

element

public Element element(QName qName)
Specified by:
element in interface Element
Overrides:
element in interface org.dom4j.tree.DefaultElement

elementIndex

protected Map elementIndex()

elements

public List elements(String name)
Specified by:
elements in interface Element
Overrides:
elements in interface org.dom4j.tree.AbstractElement

elements

public List elements(QName qName)
Specified by:
elements in interface Element
Overrides:
elements in interface org.dom4j.tree.AbstractElement

removeFromAttributeIndex

protected void removeFromAttributeIndex(Object key,
                                        Attribute value)

removeFromAttributeIndex

protected void removeFromAttributeIndex(Attribute attribute)

removeFromElementIndex

protected void removeFromElementIndex(Object key,
                                      Element value)

removeFromElementIndex

protected void removeFromElementIndex(Element element)

removeNode

protected boolean removeNode(Node node)
Overrides:
removeNode in interface org.dom4j.tree.DefaultElement

Copyright B) 2005 MetaStuff Ltd. All Rights Reserved. Hosted by

SourceForge Logo