com.smallx.xml.infoset.memory
Class MemoryParent

java.lang.Object
  extended bycom.smallx.xml.infoset.memory.MemoryItem
      extended bycom.smallx.xml.infoset.memory.MemoryParent
All Implemented Interfaces:
Child, Item, Parent
Direct Known Subclasses:
MemoryDocument, MemoryElement

public abstract class MemoryParent
extends MemoryItem
implements Parent


Field Summary
protected  java.net.URI baseURI
           
protected  java.util.List children
           
 
Fields inherited from class com.smallx.xml.infoset.memory.MemoryItem
infoset, origin, ranking
 
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
 
Constructor Summary
protected MemoryParent(Infoset infoset, double ranking, java.net.URI base, Parent origin)
           
 
Method Summary
 void appendChild(Child n)
          Appends a child to the parents children list.
 java.util.Iterator getAxis(byte axis)
           
 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
 int getNumberOfChildren()
          Returns the number of children.
 Parent getParent()
          Returns the origin of this node.
 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 class com.smallx.xml.infoset.memory.MemoryItem
compareTo, getDocument, getGeneratedId, getInfoset, getOrigin, setIndex, setRank
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.smallx.xml.infoset.Parent
getDocument
 
Methods inherited from interface com.smallx.xml.infoset.Child
compareTo, getFollowingSibling, getFollowingSiblings, getPrecedingSibling, getPrecedingSiblings
 
Methods inherited from interface com.smallx.xml.infoset.Item
getGeneratedId, getInfoset, getOrigin, getType
 

Field Detail

children

protected java.util.List children

baseURI

protected java.net.URI baseURI
Constructor Detail

MemoryParent

protected MemoryParent(Infoset infoset,
                       double ranking,
                       java.net.URI base,
                       Parent origin)
Method Detail

getParent

public Parent getParent()
Description copied from interface: Child
Returns the origin of this node. This is either the element on which the attribute is declared or the parent of the node.

Specified by:
getParent in interface Child

getBaseURI

public java.net.URI getBaseURI()
Description copied from interface: Parent
Returns the base URI of the document.

Specified by:
getBaseURI in interface Parent

setBaseURI

public void setBaseURI(java.net.URI base)
Specified by:
setBaseURI in interface Parent

hasChildren

public boolean hasChildren()
Description copied from interface: Parent
Indicates if the parent has children.

Specified by:
hasChildren in interface Parent
Returns:
Returns true if the parent has children.

getChildren

public java.util.Iterator getChildren()
Description copied from interface: Parent
Returns a iteration of the children of the parent.

Specified by:
getChildren in interface Parent

getNumberOfChildren

public int getNumberOfChildren()
Description copied from interface: Parent
Returns the number of children.

Specified by:
getNumberOfChildren in interface Parent

getChildAt

public Child getChildAt(int index)
Description copied from interface: Parent
Returns the child at the specified index.

Specified by:
getChildAt in interface Parent
Parameters:
index - The zero-based index of the child to return.

removeChild

public void removeChild(Child n)
Description copied from interface: Parent
Removes a child by node identity.

Specified by:
removeChild in interface Parent
Parameters:
n - The node to remove.

removeChildAt

public void removeChildAt(int index)
Description copied from interface: Parent
Removes a child at the specified index.

Specified by:
removeChildAt in interface Parent
Parameters:
index - The zero-based index of the child to remove.

appendChild

public void appendChild(Child n)
Description copied from interface: Parent
Appends a child to the parents children list.

Specified by:
appendChild in interface Parent
Parameters:
n - The node to appent.

insertChildBefore

public void insertChildBefore(int index,
                              Child n)
Description copied from interface: Parent
Inserts a child at the specified index.

Specified by:
insertChildBefore in interface Parent
Parameters:
index - A zero-based index of the children count.
n - The node to insert.

swapChild

public void swapChild(Child oldChild,
                      Child newChild)
Description copied from interface: Parent
Swaps a child

Specified by:
swapChild in interface Parent
Parameters:
oldChild - the child to swap
newChild - the new child to swap in

getAxis

public java.util.Iterator getAxis(byte axis)
Specified by:
getAxis in interface Item
Overrides:
getAxis in class MemoryItem

getChildrenByType

public java.util.Iterator getChildrenByType(int type)
Description copied from interface: Parent
Returns the children by infoset item type

Specified by:
getChildrenByType in interface Parent
Parameters:
type - The type to return
Returns:
An interator containing the type.