public class PeriodObjectModel extends java.lang.Object implements XMLMarshallable, IPeriodObjectModel
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.
ChronologyModelThe 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 and Description |
|---|
PeriodObjectModel()
Builds an empty period object.
|
PeriodObjectModel(java.util.Date start,
java.util.Date end,
XMLMarshallable element)
Builds a full period object for an
XML-marshallable element. |
| Modifier and Type | Method and Description |
|---|---|
void |
addCharacterData(java.lang.String cData)
Adds character data to the content element.
|
void |
addChild(java.lang.String name,
XMLMarshallable child)
Adds a child to the object, the
child representing
the marshallable object which must be added to the element. |
com.highdeal.util.range.TimeFrame |
asTimeFrame()
Returns this object as
TimeFrame object. |
XMLMarshallable |
getElement()
Returns the element for this period.
|
java.util.Date |
getEnd()
Returns the end date of the period.
|
java.util.Date |
getStart()
Returns the start date of the period.
|
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, including its children.
|
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the element being
processed.
|
void |
setElement(XMLMarshallable element)
Specifies the
XML-marshallable element for this period. |
void |
setEnd(java.util.Date end)
Sets the end date of the period.
|
void |
setStart(java.util.Date start)
Sets the start date of the period.
|
public PeriodObjectModel()
public PeriodObjectModel(java.util.Date start,
java.util.Date end,
XMLMarshallable element)
XML-marshallable element.start - The start date for the elementend - The end date for the elementelement - The XML-marshallable element that is valid in this periodpublic java.util.Date getStart()
IPeriodObjectModelgetStart in interface IPeriodObjectModelnull if
the element has always been validpublic void setStart(java.util.Date start)
IPeriodObjectModelsetStart in interface IPeriodObjectModelstart - The possibly null start date of the period for
the elementpublic java.util.Date getEnd()
IPeriodObjectModelgetEnd in interface IPeriodObjectModelnull if
the element will always be validpublic void setEnd(java.util.Date end)
IPeriodObjectModelsetEnd in interface IPeriodObjectModelend - The end date of the periodpublic com.highdeal.util.range.TimeFrame asTimeFrame()
IPeriodObjectModelTimeFrame object.asTimeFrame in interface IPeriodObjectModelTimeFrame object.public XMLMarshallable getElement()
public void setElement(XMLMarshallable element)
XML-marshallable element for this period.element - The XML-marshallable element for this periodpublic void setAttributes(XMLAttributes atts)
XMLMarshallablesetAttributes in interface XMLMarshallableatts - The XML attributes of the current elementpublic void addChild(java.lang.String name,
XMLMarshallable child)
XMLMarshallablechild representing
the marshallable object which must be added to the element.addChild in interface XMLMarshallablename - The name of tag for the childchild - The child to be addedpublic void addCharacterData(java.lang.String cData)
XMLMarshallableaddCharacterData in interface XMLMarshallablecData - The character data to be addedpublic void marshal(XMLOutputter output)
XMLMarshallablemarshal in interface XMLMarshallableoutput - The XML output to marshal the object into