|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sourceforge.nite.nom.nomwrite.impl.NOMWriteElement
public abstract class NOMWriteElement
This abstract class is extended by the three different types of element in a NOM Corpus: Annotations, Objects (part of an object set) and TypeElements (part of a type hierarchy).
| Nested Class Summary | |
|---|---|
class |
NOMWriteElement.SharedElement
This inner class provides some utility functions for shared NOM users |
class |
NOMWriteElement.XMLComment
|
| Nested classes/interfaces inherited from interface net.sourceforge.nite.nom.nomwrite.NOMElement |
|---|
NOMElement.SharedEl |
| Field Summary |
|---|
| Fields inherited from interface net.sourceforge.nite.nom.nomwrite.NOMElement |
|---|
FEATURAL_LAYER, IMPLICIT_ORDER, STRUCTURAL_LAYER, TEMPORAL_ORDER, TIME_ALIGNED_LAYER, UNORDERED, UNTIMED |
| Method Summary | |
|---|---|
void |
addAfterSibling(NOMElement sibling)
add the element as a sibling of the given element. |
void |
addAttribute(NOMAttribute attribute)
add an attribute to the element |
void |
addBeforeSibling(NOMElement sibling)
add the element as a sibling of the given element. |
void |
addChild(NOMElement child)
adds a child to this element. |
void |
addChildAboveChildren(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(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(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(java.lang.String role,
java.lang.String value)
Set the href value of the external pointer from this element. |
void |
addFirstChild(NOMElement child)
adds the NOMElement as the first child |
void |
addLastChild(NOMElement child)
adds the NOMElement as the last child |
void |
addPointer(NOMPointer pointer)
add a pointer to the element |
void |
addToCorpus()
add an element to the corpus with no information about location. |
void |
appendText(java.lang.String chars)
appends to the textual content of an element. |
void |
deleteChild(NOMElement child)
Delete an element. |
java.lang.String |
endElementString()
Used in serialization - return a string containing the XML for the end of this element. |
NOMElement |
findAncestorInLayer(NLayer layer)
|
NOMElement |
findAncestorNamed(java.lang.String name)
|
java.util.List |
findAncestorsInFile()
|
java.util.Set |
findAncestorsInLayer(NLayer layer)
|
java.util.Set |
findAncestorsNamed(java.lang.String name)
|
NOMElement |
findCommonAncestorInFile(NOMElement other)
|
java.util.List |
findDescendantsInLayer(NLayer layer)
|
java.util.List |
findDescendantsNamed(java.lang.String name)
|
NAgent |
getAgent()
Returns the agent responsible for the element (or null if it's not in an agent coding). |
java.lang.String |
getAgentName()
returns the name of the agent responsible for the element. |
NOMAttribute |
getAttribute(java.lang.String attribute_name)
returns the named attribute if it exists |
java.lang.Comparable |
getAttributeComparableValue(java.lang.String name)
Returns the value of an attribute specified by his name as Comparable. |
java.util.List |
getAttributes()
returns a List of NOMAttributes |
int |
getChildOrder()
specifies whether the children are temporally ordered, implicitly ordered or unordered by returning one of UNORDERED, IMPLICIT_ORDER or TEMPORAL_ORDER |
java.util.List |
getChildren()
returns a List of NOMElements: the children of this element (not including comment elements) |
java.util.List |
getChildrenWithInterleavedComments()
This version of getChildren includes any comments that are present in the correct order within the child stream. |
java.lang.String |
getColour()
returns the "colour" of the element: we use 'colour' in an NXT-specific way: it's precisely the filename the element will be serailized into, without its the '.xml' extension: thus it comprises observation name; '.'; the agent name followed by '.' (if an agent coding); the coding name. |
java.lang.String |
getComment()
returns the contents of the reserved comment String (or null if not set) |
NOMCorpus |
getCorpus()
Simply return the Corpus that this element is a part of |
double |
getEndTime()
Get the end time of this element. |
java.lang.String |
getExternalPointerValue()
returns the value of any external pointer from this element. |
java.lang.String |
getGVM()
returns the Graphical Visual Markup string for the element |
java.lang.String |
getID()
returns the ID of the element |
java.lang.String |
getIDLink()
returns a string containing a Link to this element (without the filename) |
java.lang.String |
getKeyStroke()
returns the keystroke associated with this element (as a string) |
NLayer |
getLayer()
Returns the metadata layer to which this element belongs. |
java.lang.String |
getLink()
returns a string containing a full Link to this element including filename |
NElement |
getMetadataElement()
Returns the metadata element for this element. |
java.lang.String |
getName()
returns the name of the element |
NOMElement |
getNextElement()
returns the element following this one in the corpus if it were to be serialized |
NOMElement |
getNextSibling()
returns this element's following sibling of the same colour |
java.util.List |
getNiteChildren()
returns a List of nite_children - these should not be of interest once the NOM is fully loaded. |
java.lang.String |
getObservation()
returns the name of the observation to which the element belongs |
NOMElement |
getParentInFile()
returns the NOMElement belonging to the same colour (i.e. |
java.util.List |
getParents()
returns a List of NOMElements |
java.util.List |
getPointers()
returns a List of NOMPointers |
java.util.List |
getPointersTo()
returns a List of NOMPointers that point to this element |
NOMPointer |
getPointerWithRole(java.lang.String rolename)
returns the first NOMPointer which has a matching role |
NOMElement |
getPreviousSibling()
returns this element's previous sibling of the same colour |
int |
getRecursiveDepth()
get the actual recursive depth of this element in its recursive layer where 0 means no parents in this layer; 1 means one etc. |
int |
getRecursiveHeight()
get the actual recursive height of this element in its recursive layer where 0 means no children in this layer; 1 means kids to a depth of 1 etc. |
NOMElement.SharedEl |
getShared()
return a shared view of this element which simply provides utility functions for editing the element without thinking about locking and unlocking the corpus. |
double |
getStartTime()
Get the start time of this element. |
java.lang.String |
getText()
gets the textual content of an element. |
int |
getTimeType()
returns the integer TIME_ALIGNED, STRUCTURAL or FEATURAL: the type of the element as far as timing is concerned. |
java.lang.String |
getXLink()
Returns the xlink:href to the element this element is stored. |
boolean |
hasNextElement()
returns true if there is an element following this one in the corpus if it were to be serialized |
void |
inheritTimes()
Inherit start and end times from timed child nodes. |
void |
insertParent(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 |
boolean |
isComment()
returns true if this element is a comment |
boolean |
isLeaf()
returns true if this element is a leaf (according to the metadata) |
boolean |
isStreamElement()
returns true if this is a "stream" element - i.e. |
java.lang.Boolean |
isStreamElementOld()
returns true if this is a "stream" element - i.e. |
void |
removeAttribute(java.lang.String name)
Remove an attribute completely from an element |
void |
removeChild(NOMElement child)
Remove a nite:child from an element without actually deleting the element referred to. |
void |
removeParentAndAdjust(NOMElement par)
Remove the parent node, making me and my siblings children of our grandparent. |
void |
removePointer(NOMPointer pointer)
remove a pointer from the element |
void |
setComment(java.lang.String comment)
sets the comment attribute for this element |
void |
setDoubleAttribute(java.lang.String name,
java.lang.Double value)
Set the value of a named Double attribute; Create the attribute if it doesn't exist. |
void |
setEndTime(double et)
Set the end time of this element. |
void |
setGVM(java.lang.String name)
sets the GVM string for this element |
void |
setKeyStroke(java.lang.String name)
sets the keystroke string associated with this element |
void |
setName(java.lang.String name)
sets the name of the element - not commonly used! |
void |
setStartTime(double st)
Set the start time of this element. |
void |
setStreamElement(boolean stream)
Set the "stream"ness of the element - a stream element is one which is purely there as a container for other elements for the purposes of serialization. |
void |
setStringAttribute(java.lang.String name,
java.lang.String value)
Set the value of a named string attribute; create the attribute if it doesn't exist. |
void |
setText(java.lang.String chars)
sets the textual content of an element. |
java.lang.String |
startElementString()
Used in serialization - return a string containing the XML for the start of this element including attributes. |
void |
updateTimes()
Called when a change to the start or end time of a timed unit by the user requires propagation |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void setStringAttribute(java.lang.String name,
java.lang.String value)
throws NOMException
setStringAttribute in interface NOMElementNOMException
public void setDoubleAttribute(java.lang.String name,
java.lang.Double value)
throws NOMException
setDoubleAttribute in interface NOMElementNOMException
public void removeAttribute(java.lang.String name)
throws NOMException
removeAttribute in interface NOMElementNOMExceptionpublic java.util.List getPointers()
getPointers in interface NOMElementpublic java.util.List getPointersTo()
getPointersTo in interface NOMElementpublic NOMPointer getPointerWithRole(java.lang.String rolename)
getPointerWithRole in interface NOMElementpublic java.lang.String getExternalPointerValue()
getExternalPointerValue in interface NOMElement
public void addPointer(NOMPointer pointer)
throws NOMException
addPointer in interface NOMElementNOMException
public void removePointer(NOMPointer pointer)
throws NOMException
removePointer in interface NOMElementNOMException
public void addFirstChild(NOMElement child)
throws NOMException
addFirstChild in interface NOMElementNOMException
public void addLastChild(NOMElement child)
throws NOMException
addLastChild in interface NOMElementNOMException
public void addChildBefore(NOMElement oldchild,
NOMElement newchild)
throws NOMException
addChildBefore in interface NOMElementNOMException
public void addChildAfter(NOMElement oldchild,
NOMElement newchild)
throws NOMException
addChildAfter in interface NOMElementNOMException
public void addChildAboveChildren(NOMElement newchild,
java.util.List old_children)
throws NOMException
addChildAboveChildren in interface NOMElementNOMException
public void insertParent(NOMElement newparent,
NOMElement oldparent)
throws NOMException
insertParent in interface NOMElementNOMException
public void removeParentAndAdjust(NOMElement par)
throws NOMException
removeParentAndAdjust in interface NOMElementNOMException
public void removeChild(NOMElement child)
throws NOMException
removeChild in interface NOMElementNOMException
public void deleteChild(NOMElement child)
throws NOMException
deleteChild in interface NOMElementNOMException
public void addChild(NOMElement child)
throws NOMException
addChild in interface NOMElementNOMException
public void addToCorpus()
throws NOMException
addToCorpus in interface NOMElementNOMException
public void addBeforeSibling(NOMElement sibling)
throws NOMException
addBeforeSibling in interface NOMElementNOMException
public void addAfterSibling(NOMElement sibling)
throws NOMException
addAfterSibling in interface NOMElementNOMExceptionpublic NOMCorpus getCorpus()
getCorpus in interface NOMElementpublic java.lang.String getName()
getName in interface NOMElementpublic java.lang.String getID()
getID in interface NOMElementpublic java.lang.String getGVM()
getGVM in interface NOMElementpublic java.lang.String getKeyStroke()
getKeyStroke in interface NOMElementpublic java.lang.String getComment()
getComment in interface NOMElementpublic java.lang.String getAgentName()
getAgentName in interface NOMElementpublic NAgent getAgent()
getAgent in interface NOMElementpublic java.lang.String getColour()
getColour in interface NOMElementpublic java.lang.String getObservation()
getObservation in interface NOMElementpublic java.util.List getChildren()
getChildren in interface NOMElementpublic java.util.List getChildrenWithInterleavedComments()
getChildrenWithInterleavedComments in interface NOMElementpublic boolean isLeaf()
public boolean isComment()
isComment in interface NOMElementpublic void setName(java.lang.String name)
setName in interface NOMElementpublic void setGVM(java.lang.String name)
setGVM in interface NOMElementpublic void setKeyStroke(java.lang.String name)
setKeyStroke in interface NOMElementpublic void setComment(java.lang.String comment)
setComment in interface NOMElement
public void setText(java.lang.String chars)
throws NOMException
setText in interface NOMElementNOMException
public void appendText(java.lang.String chars)
throws NOMException
appendText in interface NOMElementNOMExceptionpublic java.lang.String getText()
getText in interface NOMElementpublic java.util.List getParents()
getParents in interface NOMElementpublic NOMElement findAncestorNamed(java.lang.String name)
findAncestorNamed in interface NOMElementpublic java.util.List findAncestorsInFile()
findAncestorsInFile in interface NOMElementpublic NOMElement findAncestorInLayer(NLayer layer)
findAncestorInLayer in interface NOMElementpublic java.util.Set findAncestorsNamed(java.lang.String name)
findAncestorsNamed in interface NOMElementpublic NOMElement findCommonAncestorInFile(NOMElement other)
findCommonAncestorInFile in interface NOMElementpublic java.util.Set findAncestorsInLayer(NLayer layer)
findAncestorsInLayer in interface NOMElementpublic java.util.List findDescendantsInLayer(NLayer layer)
findDescendantsInLayer in interface NOMElementpublic java.util.List findDescendantsNamed(java.lang.String name)
findDescendantsNamed in interface NOMElementpublic NOMElement getParentInFile()
getParentInFile in interface NOMElementpublic java.util.List getAttributes()
getAttributes in interface NOMElementpublic NOMAttribute getAttribute(java.lang.String attribute_name)
getAttribute in interface NOMElement
public void addAttribute(NOMAttribute attribute)
throws NOMException
addAttribute in interface NOMElementNOMExceptionpublic java.util.List getNiteChildren()
public int getChildOrder()
getChildOrder in interface NOMElementpublic java.lang.Boolean isStreamElementOld()
public boolean isStreamElement()
isStreamElement in interface NOMElementpublic void setStreamElement(boolean stream)
setStreamElement in interface NOMElementpublic boolean hasNextElement()
hasNextElement in interface NOMElementpublic NOMElement getNextElement()
getNextElement in interface NOMElementpublic double getStartTime()
getStartTime in interface NOMElementpublic double getEndTime()
getEndTime in interface NOMElement
public void setStartTime(double st)
throws NOMException
setStartTime in interface NOMElementNOMException
public void setEndTime(double et)
throws NOMException
setEndTime in interface NOMElementNOMExceptionpublic int getTimeType()
getTimeType in interface NOMElementpublic void inheritTimes()
public void updateTimes()
public NLayer getLayer()
throws NOMException
getLayer in interface NOMElementNOMExceptionpublic NElement getMetadataElement()
getMetadataElement in interface NOMElementpublic java.lang.String startElementString()
public java.lang.String endElementString()
public java.lang.String getLink()
getLink in interface NOMElementpublic java.lang.String getIDLink()
public NOMElement getPreviousSibling()
getPreviousSibling in interface NOMElementpublic NOMElement getNextSibling()
getNextSibling in interface NOMElementpublic int getRecursiveDepth()
getRecursiveDepth in interface NOMElement
public void addExternalPointer(java.lang.String role,
java.lang.String value)
throws NOMException
addExternalPointer in interface NOMElementNOMExceptionpublic int getRecursiveHeight()
getRecursiveHeight in interface NOMElementpublic java.lang.Comparable getAttributeComparableValue(java.lang.String name)
Comparable.
The interface Comparable is usefull to compare values. Notice
that in NOM an attribute value is primary a String and if
possible interpreted as Double. Because both,
String and Double, implement Comparable
attribute values could be tried to parse as Double when
setting and not when getting it. This will speed up reading, like i.e.
needed for searching.
getAttributeComparableValue in interface NOMElementname - the name of the attribute
Comparablepublic java.lang.String getXLink()
getXLink in interface NOMElementpublic NOMElement.SharedEl getShared()
getShared in interface NOMElement
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||