net.sourceforge.nite.nom.nomwrite.impl
Class NOMWriteElement.SharedElement

java.lang.Object
  extended by net.sourceforge.nite.nom.nomwrite.impl.NOMWriteElement.SharedElement
All Implemented Interfaces:
NOMElement.SharedEl
Enclosing class:
NOMWriteElement

public class NOMWriteElement.SharedElement
extends java.lang.Object
implements NOMElement.SharedEl

This inner class provides some utility functions for shared NOM users


Constructor Summary
NOMWriteElement.SharedElement(NOMWriteElement nwa)
           
 
Method Summary
 void addAfterSibling(NOMView view, NOMElement sibling)
          add the element as a sibling of the given element.
 void addAttribute(NOMView view, NOMAttribute attribute)
          add an attribute to the element.
 void addBeforeSibling(NOMView view, NOMElement sibling)
          add the element as a sibling of the given element.
 void addChild(NOMView view, NOMElement child)
          adds a child to this element.
 void addChildAboveChildren(NOMView view, NOMElement newchild, java.util.List old_children)
          adds the NOMElement newchild in place of the given child list, making the current children chilren of the newly added node.
 void addChildAfter(NOMView view, NOMElement oldchild, NOMElement newchild)
          adds the NOMElement newchild immediately after the given existing child, or reports an exception if the child cannot be found.
 void addChildBefore(NOMView view, NOMElement oldchild, NOMElement newchild)
          adds the NOMElement newchild immediately before the given existing child, or reports an exception if the child cannot be found.
 void addExternalPointer(NOMView view, java.lang.String role, java.lang.String value)
          Set the href value of the external pointer from this element.
 void addFirstChild(NOMView view, NOMElement child)
          adds the NOMElement as the first child.
 void addLastChild(NOMView view, NOMElement child)
          adds the NOMElement as the last child.
 void addPointer(NOMView view, NOMPointer pointer)
          add a pointer to the element.
 void addToCorpus(NOMView view)
          add an element to the corpus with no information about location.
 void deleteChild(NOMView view, NOMElement child)
          Delete an element.
 void insertParent(NOMView view, NOMElement newparent, NOMElement oldparent)
          Insert an new parent node, making me and my siblings children of our the new parent and making our current parent the parent of the new parent
 void removeAttribute(NOMView view, java.lang.String name)
          Remove an attribute from the element completely.
 void removeChild(NOMView view, NOMElement child)
          Remove a nite:child from an element without actually deleting the element referred to.
 void removeParentAndAdjust(NOMView view, NOMElement par)
          Remove the parent node, making me and my siblings children of our grandparent.
 void removePointer(NOMView view, NOMPointer pointer)
          remove a pointer from the element.
 void setDoubleAttribute(NOMView view, java.lang.String name, java.lang.Double value)
          Set the value of a named Double attribute.
 void setEndTime(NOMView view, double et)
          Set the end time of this element.
 void setStartTime(NOMView view, double st)
          Set the start time of this element.
 void setStringAttribute(NOMView view, java.lang.String name, java.lang.String value)
          Set the value of a named string attribute.
 void setText(NOMView view, java.lang.String chars)
          sets the textual content of an element.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NOMWriteElement.SharedElement

public NOMWriteElement.SharedElement(NOMWriteElement nwa)
Method Detail

setStringAttribute

public void setStringAttribute(NOMView view,
                               java.lang.String name,
                               java.lang.String value)
                        throws NOMException
Set the value of a named string attribute. NOM-sharing version.

Specified by:
setStringAttribute in interface NOMElement.SharedEl
Throws:
NOMException

setDoubleAttribute

public void setDoubleAttribute(NOMView view,
                               java.lang.String name,
                               java.lang.Double value)
                        throws NOMException
Set the value of a named Double attribute. NOM-sharing version.

Specified by:
setDoubleAttribute in interface NOMElement.SharedEl
Throws:
NOMException

removeAttribute

public void removeAttribute(NOMView view,
                            java.lang.String name)
                     throws NOMException
Remove an attribute from the element completely. NOM-sharing version.

Specified by:
removeAttribute in interface NOMElement.SharedEl
Throws:
NOMException

addAttribute

public void addAttribute(NOMView view,
                         NOMAttribute attribute)
                  throws NOMException
add an attribute to the element. NOM-sharing version

Specified by:
addAttribute in interface NOMElement.SharedEl
Throws:
NOMException

addPointer

public void addPointer(NOMView view,
                       NOMPointer pointer)
                throws NOMException
add a pointer to the element. NOM-sharing version.

Specified by:
addPointer in interface NOMElement.SharedEl
Throws:
NOMException

removePointer

public void removePointer(NOMView view,
                          NOMPointer pointer)
                   throws NOMException
remove a pointer from the element. NOM-sharing version.

Specified by:
removePointer in interface NOMElement.SharedEl
Throws:
NOMException

addFirstChild

public void addFirstChild(NOMView view,
                          NOMElement child)
                   throws NOMException
adds the NOMElement as the first child. NOM-sharing version.

Specified by:
addFirstChild in interface NOMElement.SharedEl
Throws:
NOMException

addLastChild

public void addLastChild(NOMView view,
                         NOMElement child)
                  throws NOMException
adds the NOMElement as the last child. NOM-sharing version.

Specified by:
addLastChild in interface NOMElement.SharedEl
Throws:
NOMException

addChildBefore

public void addChildBefore(NOMView view,
                           NOMElement oldchild,
                           NOMElement newchild)
                    throws NOMException
adds the NOMElement newchild immediately before the given existing child, or reports an exception if the child cannot be found. NOM-sharing version.

Specified by:
addChildBefore in interface NOMElement.SharedEl
Throws:
NOMException

addChildAfter

public void addChildAfter(NOMView view,
                          NOMElement oldchild,
                          NOMElement newchild)
                   throws NOMException
adds the NOMElement newchild immediately after the given existing child, or reports an exception if the child cannot be found. NOM-sharing version.

Specified by:
addChildAfter in interface NOMElement.SharedEl
Throws:
NOMException

removeChild

public void removeChild(NOMView view,
                        NOMElement child)
                 throws NOMException
Remove a nite:child from an element without actually deleting the element referred to. Throw an error if we're trying to remove the child from its serialized parent. NOM-sharing version.

Specified by:
removeChild in interface NOMElement.SharedEl
Throws:
NOMException

deleteChild

public void deleteChild(NOMView view,
                        NOMElement child)
                 throws NOMException
Delete an element. Remove the child from all its parents. NOM-sharing version.

Specified by:
deleteChild in interface NOMElement.SharedEl
Throws:
NOMException

addChild

public void addChild(NOMView view,
                     NOMElement child)
              throws NOMException
adds a child to this element. Since no order is specified, add the child to the end of the list of children. NOM-sharing version.

Specified by:
addChild in interface NOMElement.SharedEl
Throws:
NOMException

addChildAboveChildren

public void addChildAboveChildren(NOMView view,
                                  NOMElement newchild,
                                  java.util.List old_children)
                           throws NOMException
adds the NOMElement newchild in place of the given child list, making the current children chilren of the newly added node. NOM-sharing version.

Specified by:
addChildAboveChildren in interface NOMElement.SharedEl
Throws:
NOMException

removeParentAndAdjust

public void removeParentAndAdjust(NOMView view,
                                  NOMElement par)
                           throws NOMException
Remove the parent node, making me and my siblings children of our grandparent. Possibly need to check validity...

Specified by:
removeParentAndAdjust in interface NOMElement.SharedEl
Throws:
NOMException

insertParent

public void insertParent(NOMView view,
                         NOMElement newparent,
                         NOMElement oldparent)
                  throws NOMException
Insert an new parent node, making me and my siblings children of our the new parent and making our current parent the parent of the new parent

Specified by:
insertParent in interface NOMElement.SharedEl
Throws:
NOMException

setText

public void setText(NOMView view,
                    java.lang.String chars)
             throws NOMException
sets the textual content of an element. NOM-sharing version.

Specified by:
setText in interface NOMElement.SharedEl
Throws:
NOMException

setStartTime

public void setStartTime(NOMView view,
                         double st)
                  throws NOMException
Set the start time of this element. Only elements in a timed layer can have their start and end times set directly; all structural times are strictly inherited. NOM-sharing version.

Specified by:
setStartTime in interface NOMElement.SharedEl
Throws:
NOMException

setEndTime

public void setEndTime(NOMView view,
                       double et)
                throws NOMException
Set the end time of this element. Only elements in a timed layer can have their start and end times set directly; all structural times are strictly inherited. NOM-sharing version.

Specified by:
setEndTime in interface NOMElement.SharedEl
Throws:
NOMException

addToCorpus

public void addToCorpus(NOMView view)
                 throws NOMException
add an element to the corpus with no information about location. This should only be used with elements that are in the top level of a coding. If the element is in a timed layer and has start and end times, the placement of the addition in the "stream" is derived from those. Otherwise the element is added at the end of the stream. NOM-sharing version

Specified by:
addToCorpus in interface NOMElement.SharedEl
Throws:
NOMException

addBeforeSibling

public void addBeforeSibling(NOMView view,
                             NOMElement sibling)
                      throws NOMException
add the element as a sibling of the given element. Of course the siblings must be in the same layer and the ordering must not violate any of the precedence constraints. NOM-sharing version.

Specified by:
addBeforeSibling in interface NOMElement.SharedEl
Throws:
NOMException

addAfterSibling

public void addAfterSibling(NOMView view,
                            NOMElement sibling)
                     throws NOMException
add the element as a sibling of the given element. Of course the siblings must be in the same layer and the ordering must not violate any of the precedence constraints. NOM-sharing version.

Specified by:
addAfterSibling in interface NOMElement.SharedEl
Throws:
NOMException

addExternalPointer

public void addExternalPointer(NOMView view,
                               java.lang.String role,
                               java.lang.String value)
                        throws NOMException
Set the href value of the external pointer from this element. Only allowed in elements on layers of type EXTERNAL_POINTER_LAYER. NOM-sharing version

Specified by:
addExternalPointer in interface NOMElement.SharedEl
Throws:
NOMException