Package com.highdeal.pnr.hci
Class TierTableInstanceModel
java.lang.Object
com.highdeal.pnr.hci.TierTableInstanceModel
- All Implemented Interfaces:
XMLMarshallable
This class represents a tier table instance.
The instance must meets the following constraints:
- Rows must be ordered by group name. In others words, all rows of the same group must be together.
- Rows with
nullinput string (default group) must be at the end. - Inside a group, rows must be ordered by growing lower range (empty value in first).
- Inside a group, range of rows must cover all numeric value (from -Infinity up to +Infinity)
- Inside a group, ranges must not overlap.
- Instances inside
TierTableModel(directly or throughgetInstanceChronology()) it must contains at least the default group.
XML API for HCI
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="tierTableInstance">
<xs:complexType>
<xs:sequence>
<xs:element ref="tierTableRow" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="tableCode" type="xs:string" use="required"/>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="isPrivate" type="xs:boolean" default="false"/>
<xs:attribute name="instanceName" type="xs:string"/>
</xs:complexType>
</xs:element>
-
Constructor Summary
ConstructorsConstructorDescriptionBuilds an empty TierInstanceModel.TierTableInstanceModel(String tableCode) Builds a TierTableInstanceModel from a tier table code.TierTableInstanceModel(String name, String tableCode, boolean isPrivate, String instanceName) Builds a TierTableInstanceModel from a tier table code. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCharacterData(String cData) Adds character data to the content element.voidaddChild(String tagName, XMLMarshallable child) Adds a child to the object, thechildrepresenting the marshallable object which must be added to the element.booleanChecks if the tier table instance rows are chronologicaly orderedReturns the mapped instance name.getName()Returns the name of the instance.getRows()Gets the rows.Gets the table code.booleanChecks if the tier table instance has missing periods.booleanChecks if the tier table instance has overlapping periodsbooleanReturns the visibility of the instance.booleanReturns true if the tier table is valid.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.voidsetInstanceName(String instanceName) Sets the mapped instance name.voidSets the name of the instance.voidsetPrivate(boolean isPrivate) Sets the instance visibility.voidsetTableCode(String code) Sets the table code.
-
Constructor Details
-
TierTableInstanceModel
public TierTableInstanceModel()Builds an empty TierInstanceModel. -
TierTableInstanceModel
public TierTableInstanceModel(String name, String tableCode, boolean isPrivate, String instanceName) Builds a TierTableInstanceModel from a tier table code.- Parameters:
name-tableCode-isPrivate-instanceName-
-
TierTableInstanceModel
Builds a TierTableInstanceModel from a tier table code.- Parameters:
tableCode-
-
-
Method Details
-
getTableCode
Gets the table code.- Returns:
- the table code.
-
setTableCode
Sets the table code.- Parameters:
code- the table code.
-
getName
Returns the name of the instance.- Returns:
- the name of the instance.
-
setName
Sets the name of the instance.- Parameters:
name- the name of the instance.
-
getRows
Gets the rows.- Returns:
- a Vector of
TierTableRowModelrepresenting rows.
-
getInstanceName
Returns the mapped instance name.- Returns:
- the name of the mapped instance.
-
setInstanceName
Sets the mapped instance name.- Parameters:
instanceName- the name of the mapped instance.
-
isPrivate
public boolean isPrivate()Returns the visibility of the instance.- Returns:
trueif the instance is private.
-
setPrivate
public void setPrivate(boolean isPrivate) Sets the instance visibility.- Parameters:
isPrivate- the level of the visibility.
-
isValid
Returns true if the tier table is valid.- Parameters:
tm- the tier table Model.- Returns:
- true if the tier table is valid, false otherwise.
-
hasMissingPeriods
public boolean hasMissingPeriods()Checks if the tier table instance has missing periods. More precisely this method tests if the inclusion/exclusion of bounds of consecutive row are consistent.- Returns:
- true if the tier table instance has missing periods, false otherwise.
-
hasOverlappingPeriods
public boolean hasOverlappingPeriods()Checks if the tier table instance has overlapping periods- Returns:
- true if the tier table instance has overlapping periods, false otherwise.
-
areRowsOrdered
public boolean areRowsOrdered()Checks if the tier table instance rows are chronologicaly ordered- Returns:
- true if the tier table instance rows are chronologicaly ordered, false otherwise.
-
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
-
addCharacterData
Description copied from interface:XMLMarshallableAdds character data to the content element.- Specified by:
addCharacterDatain interfaceXMLMarshallable- Parameters:
cData- The character data to be added
-
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:
tagName- The name of tag for the childchild- The child 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
-