Interface TDocument

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

public interface TDocument
extends org.w3c.dom.Document

The TDocument interface represents a temporal XML document. It provides access to the data and the temporal information in the document under the user-defined temporal constraints.


Field Summary
static short MODE_CURRENT
          Current mode.
static short MODE_REPRESENTATIONAL
          Representational mode.
static short MODE_SEQUENCED
          Sequenced mode.
 
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
 VersionedElement createVersionedElement(java.lang.String name)
          Create a VersionedElement with the given name in sequenced mode.
 java.util.Date getCurrentInstant()
          Return the current instant when TDOM is in current mode.
 java.lang.String getDateFormat()
          Return the pattern string used to parse date string.
 short getMode()
          Return the TDOM's working mode.
 Period getSequencedExtent()
          Return the period of applicability when TDOM is in sequenced mode.
 void setModeCurrent(java.lang.String pattern, java.util.Date current)
          Make TDOM work in current mode.
 void setModeCurrent(java.lang.String pattern, java.lang.String current)
          Make TDOM work in current mode.
 void setModeRepresentational()
          Make TDOM work in representational mode.
 void setModeSequenced(java.lang.String pattern, Period seq_period)
          Make TDOM work in sequenced mode.
 void setModeSequenced(java.lang.String pattern, java.lang.String begin, java.lang.String end)
          Make TDOM work in sequenced mode.
 
Methods inherited from interface org.w3c.dom.Document
createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, getDoctype, getDocumentElement, getElementById, getElementsByTagName, getElementsByTagNameNS, getImplementation, importNode
 
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
 

Field Detail

MODE_REPRESENTATIONAL

public static final short MODE_REPRESENTATIONAL
Representational mode. TDOM operates the same as DOM in representational mode.

See Also:
Constant Field Values

MODE_CURRENT

public static final short MODE_CURRENT
Current mode. TDOM provides access to the data that is valid at an instant of time in current mode.

See Also:
Constant Field Values

MODE_SEQUENCED

public static final short MODE_SEQUENCED
Sequenced mode. TDOM provides access to the data that are valid in a specified period in sequenced mode.

See Also:
Constant Field Values
Method Detail

setModeRepresentational

public void setModeRepresentational()
                             throws TDOMException
Make TDOM work in representational mode.

Throws:
TDOMException - Throw TDOMException with exception code MODE_FIXED if the mode is already fixed to current or sequenced mode.

setModeCurrent

public void setModeCurrent(java.lang.String pattern,
                           java.lang.String current)
                    throws TDOMException
Make TDOM work in current mode.

Parameters:
pattern - The pattern of strings that denote date in the document and by user.
current - A string denoting an instant. TDOM provides access to data valid at this instant. This string must be able to be parsed using the pattern.
Throws:
TDOMException - Throw TDOMException with exception code MODE_FIXED if the mode is already fixed to representational or sequenced mode. Throw TDOMException with exception code INVALID_DATE_FORMAT if the pattern is not valid. Throw TDOMException with exception code INVALID_TIME_INSTANT if the current string isn't parsable using the pattern string.

setModeCurrent

public void setModeCurrent(java.lang.String pattern,
                           java.util.Date current)
                    throws TDOMException
Make TDOM work in current mode.

Parameters:
pattern - The pattern of strings that denote date in the document.
current - Denote the current instant. TDOM provides access to data valid at this instant.
Throws:
TDOMException - Throw TDOMException with exception code MODE_FIXED if the mode is already fixed to representational or sequenced mode. Throw TDOMException with exception code INVALID_DATE_FORMAT if the pattern is not valid.

setModeSequenced

public void setModeSequenced(java.lang.String pattern,
                             java.lang.String begin,
                             java.lang.String end)
                      throws TDOMException
Make TDOM work in sequenced mode. TDOM provides access to data valid in the given period of applicability denoted by begin and end.

Parameters:
pattern - The pattern of strings that denote date in the document and by user.
begin - A string denoting the beginning of a period. This string must be able to be parsed using the pattern.
end - A string denoting the end of a period. This string must be able to be parsed using the pattern.
Throws:
TDOMException - Throw TDOMException with exception code MODE_FIXED if the mode is already fixed to representational or current mode. Throw TDOMException with exception code INVALID_DATE_FORMAT if the pattern is not valid. Throw TDOMException with exception code INVALID_TIME_EXTENT if the begin or end are not parsable using pattern or don't denote valid beginning or ending of a period.

setModeSequenced

public void setModeSequenced(java.lang.String pattern,
                             Period seq_period)
                      throws TDOMException
Make TDOM work in sequenced mode. TDOM provides access to data valid in a specified period.

Parameters:
pattern - The pattern of strings that denote date in the document and by user.
seq_period - The period of applicability.
Throws:
TDOMException - Throw TDOMException with exception code MODE_FIXED if the mode is already fixed to representational or current mode. Throw TDOMException with exception code INVALID_DATE_FORMAT if the pattern is not valid.

getMode

public short getMode()
Return the TDOM's working mode.

Returns:
TDOM's working mode. It can be MODE_REPRESENTATIONAL, MODE_CURRENT or MODE_SEQUENCED.

getDateFormat

public java.lang.String getDateFormat()
                               throws TDOMException
Return the pattern string used to parse date string.

Returns:
The pattern string.
Throws:
TDOMException - Throw TDOMException with exception code INAPPROP_TIME_MODE if TDOM isn't in current or sequenced mode.

getCurrentInstant

public java.util.Date getCurrentInstant()
                                 throws TDOMException
Return the current instant when TDOM is in current mode.

Returns:
Current instant of current mode.
Throws:
TDOMException - Throw TDOMException with exception code INAPPROP_TIME_MODE if TDOM isn't in current mode.

getSequencedExtent

public Period getSequencedExtent()
                          throws TDOMException
Return the period of applicability when TDOM is in sequenced mode.

Returns:
Sequenced applicability of sequenced mode.
Throws:
TDOMException - Throw TDOMException with exception code INAPPROP_TIME_MODE if TDOM isn't in sequenced mode.

createVersionedElement

public VersionedElement createVersionedElement(java.lang.String name)
                                        throws TDOMException
Create a VersionedElement with the given name in sequenced mode.

Parameters:
name - the name of the created element.
Returns:
A new VersionedElement.
Throws:
TDOMException - Throw TDOMException with exception code INAPPROP_TIME_MODE if TDOM isn't in sequenced mode.