Package com.highdeal.chrono.hci
Class PeriodObjectModel
java.lang.Object
com.highdeal.chrono.hci.PeriodObjectModel
- All Implemented Interfaces:
IPeriodObjectModel,XMLMarshallable
This
Java class defines a period object that represents a data object
(see XML-marshallable element) valid upon a certain period of time specified by a
start timestamp and an end timestamp;
This class is necessary to handle a chronology of data elements.
Note
The timestamps can
be null, meaning that the object has no defined starting and/or ending.
- See Also:
XML API for HCI
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="period">
<xs:complexType>
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="start" type="xs:dateTime"/>
<xs:attribute name="end" type="xs:dateTime"/>
</xs:complexType>
</xs:element>
-
Constructor Summary
ConstructorsConstructorDescriptionBuilds an empty period object.PeriodObjectModel(Date start, Date end, XMLMarshallable element) Builds a full period object for anXML-marshallable element. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCharacterData(String cData) Adds character data to the content element.voidaddChild(String name, XMLMarshallable child) Adds a child to the object, thechildrepresenting the marshallable object which must be added to the element.com.highdeal.util.range.TimeFrameReturns this object asTimeFrameobject.Returns the element for this period.getEnd()Returns the end date of the period.getStart()Returns the start date of the period.voidmarshal(XMLOutputter output) Gives an XML representation of this object, including its children.voidsetAttributes(XMLAttributes atts) Sets the attributes of the XML representation of the element being processed.voidsetElement(XMLMarshallable element) Specifies theXML-marshallable elementfor this period.voidSets the end date of the period.voidSets the start date of the period.
-
Constructor Details
-
PeriodObjectModel
public PeriodObjectModel()Builds an empty period object. -
PeriodObjectModel
Builds a full period object for anXML-marshallable element.- Parameters:
start- The start date for the elementend- The end date for the elementelement- TheXML-marshallable elementthat is valid in this period
-
-
Method Details
-
getStart
Description copied from interface:IPeriodObjectModelReturns the start date of the period.- Specified by:
getStartin interfaceIPeriodObjectModel- Returns:
- The start date of the period, or
nullif theelementhas always been valid
-
setStart
Description copied from interface:IPeriodObjectModelSets the start date of the period.- Specified by:
setStartin interfaceIPeriodObjectModel- Parameters:
start- The possiblynullstart date of the period for theelement
-
getEnd
Description copied from interface:IPeriodObjectModelReturns the end date of the period.- Specified by:
getEndin interfaceIPeriodObjectModel- Returns:
- The end date of the period, or
nullif theelementwill always be valid
-
setEnd
Description copied from interface:IPeriodObjectModelSets the end date of the period.- Specified by:
setEndin interfaceIPeriodObjectModel- Parameters:
end- The end date of the period
-
asTimeFrame
public com.highdeal.util.range.TimeFrame asTimeFrame()Description copied from interface:IPeriodObjectModelReturns this object asTimeFrameobject.- Specified by:
asTimeFramein interfaceIPeriodObjectModel- Returns:
- this object as
TimeFrameobject.
-
getElement
Returns the element for this period.- Returns:
- The element for this period
-
setElement
Specifies theXML-marshallable elementfor this period.- Parameters:
element- TheXML-marshallable elementfor this period
-
setAttributes
Description copied from interface:XMLMarshallableSets the attributes of the XML representation of the element being processed.- Specified by:
setAttributesin interfaceXMLMarshallable- Parameters:
atts- TheXML attributesof the current element
-
addChild
Description copied from interface:XMLMarshallableAdds a child to the object, thechildrepresenting the marshallable object which must be added to the element.- Specified by:
addChildin interfaceXMLMarshallable- Parameters:
name- The name of tag for the childchild- The child to be added
-
addCharacterData
Description copied from interface:XMLMarshallableAdds character data to the content element.- Specified by:
addCharacterDatain interfaceXMLMarshallable- Parameters:
cData- The character data to be added
-
marshal
Description copied from interface:XMLMarshallableGives an XML representation of this object, including its children.- Specified by:
marshalin interfaceXMLMarshallable- Parameters:
output- TheXML outputto marshal the object into
-