com.smallx.xml.infoset
Interface Parent

All Superinterfaces:
Child, Item
All Known Subinterfaces:
Document, Element
All Known Implementing Classes:
MemoryDocument, MemoryElement, MemoryParent

public interface Parent
extends Child

This interface represents a node that is a parent.


Field Summary
 
Fields inherited from interface com.smallx.xml.infoset.Item
ANCESTOR_AXIS, ANCESTOR_OR_SELF_AXIS, ATTRIBUTE, ATTRIBUTE_AXIS, CHARACTERS, CHILD_AXIS, COMMENT, DESCENDANT_AXIS, DESCENDANT_OR_SELF_AXIS, DOCUMENT, DOCUMENT_END, ELEMENT, ELEMENT_END, FOLLOWING_AXIS, FOLLOWING_SIBLING_AXIS, N_TYPES, NAMESPACE, NAMESPACE_AXIS, PARENT_AXIS, PRECEDING_AXIS, PRECEDING_SIBLING_AXIS, PROCESSING_INSTRUCTION, SELF_AXIS
 
Method Summary
 void appendChild(Child n)
          Appends a child to the parents children list.
 java.net.URI getBaseURI()
          Returns the base URI of the document.
 Child getChildAt(int index)
          Returns the child at the specified index.
 java.util.Iterator getChildren()
          Returns a iteration of the children of the parent.
 java.util.Iterator getChildrenByType(int type)
          Returns the children by infoset item type
 Document getDocument()
          This method returns the same as getOrigin().getDocument().
 int getNumberOfChildren()
          Returns the number of children.
 boolean hasChildren()
          Indicates if the parent has children.
 void insertChildBefore(int index, Child n)
          Inserts a child at the specified index.
 void removeChild(Child n)
          Removes a child by node identity.
 void removeChildAt(int index)
          Removes a child at the specified index.
 void setBaseURI(java.net.URI base)
           
 void swapChild(Child oldChild, Child newChild)
          Swaps a child
 
Methods inherited from interface com.smallx.xml.infoset.Child
compareTo, getFollowingSibling, getFollowingSiblings, getParent, getPrecedingSibling, getPrecedingSiblings
 
Methods inherited from interface com.smallx.xml.infoset.Item
getAxis, getGeneratedId, getInfoset, getOrigin, getType
 

Method Detail

getBaseURI

public java.net.URI getBaseURI()
Returns the base URI of the document.


setBaseURI

public void setBaseURI(java.net.URI base)

getDocument

public Document getDocument()
Description copied from interface: Item
This method returns the same as getOrigin().getDocument(). That is, the document that contains this item.

Specified by:
getDocument in interface Child

hasChildren

public boolean hasChildren()
Indicates if the parent has children.

Returns:
Returns true if the parent has children.

getChildren

public java.util.Iterator getChildren()
Returns a iteration of the children of the parent.


getNumberOfChildren

public int getNumberOfChildren()
Returns the number of children.


getChildAt

public Child getChildAt(int index)
Returns the child at the specified index.

Parameters:
index - The zero-based index of the child to return.

removeChild

public void removeChild(Child n)
Removes a child by node identity.

Parameters:
n - The node to remove.

removeChildAt

public void removeChildAt(int index)
Removes a child at the specified index.

Parameters:
index - The zero-based index of the child to remove.

appendChild

public void appendChild(Child n)
Appends a child to the parents children list.

Parameters:
n - The node to appent.

insertChildBefore

public void insertChildBefore(int index,
                              Child n)
Inserts a child at the specified index.

Parameters:
index - A zero-based index of the children count.
n - The node to insert.

swapChild

public void swapChild(Child oldChild,
                      Child newChild)
Swaps a child

Parameters:
oldChild - the child to swap
newChild - the new child to swap in

getChildrenByType

public java.util.Iterator getChildrenByType(int type)
Returns the children by infoset item type

Parameters:
type - The type to return
Returns:
An interator containing the type.