org.jdom
public interface Parent extends Cloneable, Serializable
Version: $Revision: 1.12 $, $Date: 2004/08/31 21:47:51 $
Method Summary | |
---|---|
Object | clone()
Obtain a deep, unattached copy of this parent and it's children.
|
List | cloneContent()
Returns a list containing detached clones of this parent's content list.
|
Content | getContent(int index)
Returns the child at the given index.
|
List | getContent()
Returns the full content of this parent as a java.util.List
which contains objects of type Content. |
List | getContent(Filter filter)
Returns as a java.util.List the content of
this parent that matches the supplied filter. |
int | getContentSize()
Returns the number of children in this parent's content list.
|
Iterator | getDescendants()
Returns an java.util.Iterator that walks over all descendants
in document order.
|
Iterator | getDescendants(Filter filter)
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. |
Document | getDocument()
Return this parent's owning document or null if the branch containing
this parent is currently not attached to a document.
|
Parent | getParent()
Return this parent's parent, or null if this parent is currently
not attached to another parent. |
int | indexOf(Content child)
Returns the index of the supplied child in the content list,
or -1 if not a child of this parent.
|
List | removeContent()
Removes all content from this parent and returns the detached
children.
|
List | removeContent(Filter filter)
Removes from this parent all child content matching the given filter
and returns a list of the detached children.
|
boolean | removeContent(Content child)
Removes a single child node from the content list.
|
Content | removeContent(int index)
Removes and returns the child at the given
index, or returns null if there's no such child.
|
Returns: a deep copy of this parent and it's children.
Returns: list of cloned child content
Parameters: index location of desired child
Returns: child at the given index
Throws: 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
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
Throws: IllegalStateException if parent is a Document and the root element is not set
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
Throws: IllegalStateException if parent is a Document and the root element is not set
Returns: number of children
Returns: an iterator to walk descendants
Parameters: filter filter to select which descendants to see
Returns: an iterator to walk descendants that match a filter
Returns: this child's owning document or null if none
Returns: this parent's parent or null if none
Parameters: child child to search for
Returns: index of child, or -1 if not found
Returns: list of the old content detached from this parent
Parameters: filter filter to apply
Returns: list of the detached children matching the filter
Parameters: child child to remove
Returns: whether the removal occurred
Parameters: index index of child to remove
Returns: detached child at given index or null if no
Throws: IndexOutOfBoundsException if index is negative or beyond the current number of children