Main Page | Class Hierarchy | Class List | Class Members

org::jdom::Parent Interface Reference

Inheritance diagram for org::jdom::Parent:

org::jdom::Document org::jdom::Element List of all members.

Public Member Functions

int getContentSize ()

Package Functions

int indexOf (Content child)
List cloneContent ()
Content getContent (int index)
List getContent ()
List getContent (Filter filter)
List removeContent ()
List removeContent (Filter filter)
boolean removeContent (Content child)
Content removeContent (int index)
Object clone ()
Iterator getDescendants ()
Iterator getDescendants (Filter filter)
Parent getParent ()
Document getDocument ()

Detailed Description

Superclass for JDOM objects which are allowed to contain Content content.

See also:
org.jdom.Content

org.jdom.Document

org.jdom.Element

Author:
Bradley S. Huffman

Jason Hunter

Version:
Revision
1.12
,
Date
2004/08/31 21:47:51


Member Function Documentation

Object org::jdom::Parent::clone  )  [package]
 

Obtain a deep, unattached copy of this parent and it's children.

Returns:
a deep copy of this parent and it's children.

Implemented in org::jdom::Document, and org::jdom::Element.

List org::jdom::Parent::cloneContent  )  [package]
 

Returns a list containing detached clones of this parent's content list.

Returns:
list of cloned child content

Implemented in org::jdom::Document, and org::jdom::Element.

List org::jdom::Parent::getContent Filter  filter  )  [package]
 

Returns as a java.util.List the content of this parent that matches the supplied filter. The returned list is "live" and in document order. Any modifications to it affect the element's actual contents. Modifications are checked for conformance to XML 1.0 rules.

Sequential traversal through the List is best done with an Iterator since the underlying implement of java.util.List#size may require walking the entire list and indexed lookups may require starting at the beginning each time.

Parameters:
filter filter to apply
Returns:
a list of the content of the parent matching the filter
Exceptions:
IllegalStateException if parent is a Document and the root element is not set

Implemented in org::jdom::Document, and org::jdom::Element.

List org::jdom::Parent::getContent  )  [package]
 

Returns the full content of this parent as a java.util.List which contains objects of type Content. The returned list is "live" and in document order. Any modifications to it affect the element's actual contents. Modifications are checked for conformance to XML 1.0 rules.

Sequential traversal through the List is best done with an Iterator since the underlying implement of java.util.List#size may require walking the entire list and indexed lookups may require starting at the beginning each time.

Returns:
a list of the content of the parent
Exceptions:
IllegalStateException if parent is a Document and the root element is not set

Implemented in org::jdom::Document, and org::jdom::Element.

Content org::jdom::Parent::getContent int  index  )  [package]
 

Returns the child at the given index.

Parameters:
index location of desired child
Returns:
child at the given index
Exceptions:
IndexOutOfBoundsException if index is negative or beyond the current number of children
IllegalStateException if parent is a Document and the root element is not set

Implemented in org::jdom::Document, and org::jdom::Element.

int org::jdom::Parent::getContentSize  ) 
 

Returns the number of children in this parent's content list. Children may be any Content type.

Returns:
number of children

Implemented in org::jdom::Document, and org::jdom::Element.

Iterator org::jdom::Parent::getDescendants Filter  filter  )  [package]
 

Returns an java.util.Iterator that walks over all descendants in document order applying the Filter to return only elements that match the filter rule. With filters you can match only Elements, only Comments, Elements or Comments, only Elements with a given name and/or prefix, and so on.

Parameters:
filter filter to select which descendants to see
Returns:
an iterator to walk descendants that match a filter

Implemented in org::jdom::Document, and org::jdom::Element.

Iterator org::jdom::Parent::getDescendants  )  [package]
 

Returns an java.util.Iterator that walks over all descendants in document order.

Returns:
an iterator to walk descendants

Implemented in org::jdom::Document, and org::jdom::Element.

Document org::jdom::Parent::getDocument  )  [package]
 

Return this parent's owning document or null if the branch containing this parent is currently not attached to a document.

Returns:
this child's owning document or null if none

Implemented in org::jdom::Document.

Parent org::jdom::Parent::getParent  )  [package]
 

Return this parent's parent, or null if this parent is currently not attached to another parent. This is the same method as in Content but also added to Parent to allow more easy up-the-tree walking.

Returns:
this parent's parent or null if none

Implemented in org::jdom::Document.

int org::jdom::Parent::indexOf Content  child  )  [package]
 

Returns the index of the supplied child in the content list, or -1 if not a child of this parent.

Parameters:
child child to search for
Returns:
index of child, or -1 if not found

Implemented in org::jdom::Document, and org::jdom::Element.

Content org::jdom::Parent::removeContent int  index  )  [package]
 

Removes and returns the child at the given index, or returns null if there's no such child.

Parameters:
index index of child to remove
Returns:
detached child at given index or null if no
Exceptions:
IndexOutOfBoundsException if index is negative or beyond the current number of children

Implemented in org::jdom::Document, and org::jdom::Element.

boolean org::jdom::Parent::removeContent Content  child  )  [package]
 

Removes a single child node from the content list.

Parameters:
child child to remove
Returns:
whether the removal occurred

Implemented in org::jdom::Document, and org::jdom::Element.

List org::jdom::Parent::removeContent Filter  filter  )  [package]
 

Removes from this parent all child content matching the given filter and returns a list of the detached children.

Parameters:
filter filter to apply
Returns:
list of the detached children matching the filter

Implemented in org::jdom::Document, and org::jdom::Element.

List org::jdom::Parent::removeContent  )  [package]
 

Removes all content from this parent and returns the detached children.

Returns:
list of the old content detached from this parent

Implemented in org::jdom::Document, and org::jdom::Element.


The documentation for this interface was generated from the following file:
Generated on Thu Dec 9 10:42:05 2004 for JDOM by  doxygen 1.3.9.1