Interface VersionedElement

All Superinterfaces:
org.w3c.dom.Element, org.w3c.dom.Node

public interface VersionedElement
extends org.w3c.dom.Element

The VersionedElement interface represents an element in sequenced mode which may have multiple versions in the different sub-periods of the period of applicability. A version of an element denotes a form of its content. The content of an element in sequenced mode may change over time, so it may have multiple versions in different periods. in sequenced


Field Summary
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Method Summary
 void addVersion(org.w3c.dom.Element version, Period ts)
          Add a version valid in the specified period.
 org.w3c.dom.Node getNextSiblingInParentVersion(int index)
          Return the next sibling of this element in its parent's indexth version.
 int getNumVersion()
          Return the number of versions of this element.
 org.w3c.dom.Node getPreviousSiblingInParentVersion(int index)
          Return the previous sibling of this element in its parent's indexth version.
 PeriodSet getValidTimeStamp()
          Return the periods in which the element is valid.
 PeriodSet getValidTimeStampOfVersion(int index)
          Return the valid periods of the indexth version.
 org.w3c.dom.Element getVersion(int index)
          Return the indexth version of the element.
 boolean hasSeqAttribute(java.lang.String name)
          Test if the element has an attribute with the given name at sometime within the period of applicability.
 
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 

Method Detail

getValidTimeStamp

public PeriodSet getValidTimeStamp()
Return the periods in which the element is valid.

Returns:
A PeriodSet containing the valid periods of the element.

getNumVersion

public int getNumVersion()
Return the number of versions of this element.

Returns:
the number of versions.

getVersion

public org.w3c.dom.Element getVersion(int index)
                               throws TDOMException
Return the indexth version of the element. The range of index is from 0 to the number of versions minus 1.

Parameters:
index - the index of the wanted version.
Returns:
An Element intance representing the version.
Throws:
TDOMException - Throw TDOMException with exception code INVALID_INDEX if the index is out of range.

getValidTimeStampOfVersion

public PeriodSet getValidTimeStampOfVersion(int index)
Return the valid periods of the indexth version.

Parameters:
index - the index of the wanted version.
Returns:
A PeriodSet containing the valid periods of the version.

getPreviousSiblingInParentVersion

public org.w3c.dom.Node getPreviousSiblingInParentVersion(int index)
                                                   throws TDOMException
Return the previous sibling of this element in its parent's indexth version. Because the parent may have multiple versions and each version has its unique ordering of children, the relationship of siblings can be totally different in different versions. so we must specify in which version of the parent the previous sibling is requested.

Parameters:
index - the index of its parent's version.
Returns:
Its previous sibling in its parent's indexth version.
Throws:
TDOMException - Throw TDOMException with exception code INVALID_INDEX if the index is out of range.

getNextSiblingInParentVersion

public org.w3c.dom.Node getNextSiblingInParentVersion(int index)
                                               throws TDOMException
Return the next sibling of this element in its parent's indexth version. Because the parent may have multiple versions and each version has its unique ordering of children, the relationship of siblings can be totally different in different versions. so we must specify in which version of the parent the next sibling is requested.

Parameters:
index - the index of its parent's version.
Returns:
Its next sibling in its parent's indexth version.
Throws:
TDOMException - Throw TDOMException with exception code INVALID_INDEX if the index is out of range.

addVersion

public void addVersion(org.w3c.dom.Element version,
                       Period ts)
Add a version valid in the specified period. The content of existing versions that is valid in the specified period is replaced by the content of the new version.

Parameters:
version - an element instance representing the new version.
ts - the valid period of this version.

hasSeqAttribute

public boolean hasSeqAttribute(java.lang.String name)
Test if the element has an attribute with the given name at sometime within the period of applicability.

Returns:
True if the element has an attribute with the given name sometime in the period of applicability, false otherwise.