com.highdeal.chrono.hci
Class AbstractPeriodObjectModel

java.lang.Object
  extended by com.highdeal.hci.HCIModelAdapter
      extended by com.highdeal.chrono.hci.AbstractPeriodObjectModel
All Implemented Interfaces:
IPeriodObjectModel, ITagNameProvider, IXMLMarshallable, XMLMarshallable
Direct Known Subclasses:
RangeTableRowPeriodObjectModel

public abstract class AbstractPeriodObjectModel
extends HCIModelAdapter
implements IPeriodObjectModel

This abstract Java class defines a period that represents an object that is valid upon a certain period of time; It has an XML representation.

Important Note

The timestamps can be null, meaning that the object has no defined starting and/or ending.

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:complexType name="AbstractPeriodObjectType">
   <xs:attribute name="start" type="xs:dateTime"/>
   <xs:attribute name="end" type="xs:dateTime"/>
 </xs:complexType>


Field Summary
static java.lang.String TAG_NAME
          The XML tag name of the data model: "period"
 
Constructor Summary
AbstractPeriodObjectModel()
          Builds an empty period object.
AbstractPeriodObjectModel(java.util.Date start, java.util.Date end)
          Builds a full period object.
 
Method Summary
 com.highdeal.util.range.TimeFrame asTimeFrame()
          Returns this object as TimeFrame object.
 java.util.Date getEnd()
          Returns the end date of the period.
 java.util.Date getStart()
          Returns the start date of the period.
 java.lang.String getTagName()
          Gets the XML tag name of the HCI model.
 void marshalAttributes(XMLOutputter output)
          Gives an XML representation of the attributes of an object.
 void setAttributes(XMLAttributes atts)
          Sets the attributes of the XML representation of the element being processed.
 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 com.highdeal.hci.HCIModelAdapter
marshal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.highdeal.hci.IXMLMarshallable
marshalChildren
 
Methods inherited from interface com.highdeal.hci.XMLMarshallable
addCharacterData, addChild
 

Field Detail

TAG_NAME

public static final java.lang.String TAG_NAME
The XML tag name of the data model: "period"

See Also:
Constant Field Values
Constructor Detail

AbstractPeriodObjectModel

public AbstractPeriodObjectModel()
Builds an empty period object.


AbstractPeriodObjectModel

public AbstractPeriodObjectModel(java.util.Date start,
                                 java.util.Date end)
Builds a full period object.

Parameters:
start - The start date for the element
end - The end date for the element
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

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

marshalAttributes

public void marshalAttributes(XMLOutputter output)
Description copied from interface: IXMLMarshallable
Gives an XML representation of the attributes of an object.

Specified by:
marshalAttributes in interface IXMLMarshallable
Parameters:
output - The XML output to marshal the object attributes into

getTagName

public java.lang.String getTagName()
Description copied from interface: ITagNameProvider
Gets the XML tag name of the HCI model.

Specified by:
getTagName in interface ITagNameProvider
Returns:
The XML tag name

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.

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