com.highdeal.chrono.hci
Class PeriodObjectModel

java.lang.Object
  extended by com.highdeal.chrono.hci.PeriodObjectModel
All Implemented Interfaces:
IPeriodObjectModel, XMLMarshallable

public class PeriodObjectModel
extends java.lang.Object
implements XMLMarshallable, IPeriodObjectModel

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:
ChronologyModel

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
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.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PeriodObjectModel

public PeriodObjectModel()
Builds an empty period object.


PeriodObjectModel

public PeriodObjectModel(java.util.Date start,
                         java.util.Date end,
                         XMLMarshallable element)
Builds a full period object for an XML-marshallable element.

Parameters:
start - The start date for the element
end - The end date for the element
element - The XML-marshallable element that is valid in this period
Method Detail

getStart

public java.util.Date getStart()
Description copied from interface: IPeriodObjectModel
Returns the start date of the period.

Specified by:
getStart in interface IPeriodObjectModel
Returns:
The start date of the period, or null if the element has always been valid

setStart

public void setStart(java.util.Date start)
Description copied from interface: IPeriodObjectModel
Sets the start date of the period.

Specified by:
setStart in interface IPeriodObjectModel
Parameters:
start - The possibly null start date of the period for the element

getEnd

public java.util.Date getEnd()
Description copied from interface: IPeriodObjectModel
Returns the end date of the period.

Specified by:
getEnd in interface IPeriodObjectModel
Returns:
The end date of the period, or null if the element will always be valid

setEnd

public void setEnd(java.util.Date end)
Description copied from interface: IPeriodObjectModel
Sets the end date of the period.

Specified by:
setEnd in interface IPeriodObjectModel
Parameters:
end - The end date of the period

asTimeFrame

public com.highdeal.util.range.TimeFrame asTimeFrame()
Description copied from interface: IPeriodObjectModel
Returns this object as TimeFrame object.

Specified by:
asTimeFrame in interface IPeriodObjectModel
Returns:
this object as TimeFrame object.

getElement

public XMLMarshallable getElement()
Returns the element for this period.

Returns:
The element for this period

setElement

public void setElement(XMLMarshallable element)
Specifies the XML-marshallable element for this period.

Parameters:
element - The XML-marshallable element for this period

setAttributes

public void setAttributes(XMLAttributes atts)
Description copied from interface: XMLMarshallable
Sets the attributes of the XML representation of the element being processed.

Specified by:
setAttributes in interface XMLMarshallable
Parameters:
atts - The XML attributes of the current element

addChild

public void addChild(java.lang.String name,
                     XMLMarshallable child)
Description copied from interface: XMLMarshallable
Adds a child to the object, the child representing the marshallable object which must be added to the element.

Specified by:
addChild in interface XMLMarshallable
Parameters:
name - The name of tag for the child
child - The child to be added

addCharacterData

public void addCharacterData(java.lang.String cData)
Description copied from interface: XMLMarshallable
Adds character data to the content element.

Specified by:
addCharacterData in interface XMLMarshallable
Parameters:
cData - The character data to be added

marshal

public void marshal(XMLOutputter output)
Description copied from interface: XMLMarshallable
Gives an XML representation of this object, including its children.

Specified by:
marshal in interface XMLMarshallable
Parameters:
output - The XML output to marshal the object into

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)