Package com.highdeal.pnr.hci
Class TierTableRowModel
java.lang.Object
com.highdeal.pnr.hci.TierTableRowModel
- All Implemented Interfaces:
XMLMarshallable
This class represents a row in a tier table.
A row is composed by output values matching an input range and a group name.
While the rating, if the searched group name is not present, the default group
is used. The name of this group is a null string.
Otherwise the row could match only value with the same group name.
A lower or upper ranges can be inclusive or not (default is exclusive). For each input range, at least one or many output value(s) can be defined. Output values can be of type string or decimal.
If the lower range is not set, that means there is no lower limit. If the upper range is not set, that means there is no upper limit. If the upper and lower ranges are not set, that means there is no lower and upper limit.
XML API for HCI
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="tierTableRow">
<xs:complexType>
<xs:attribute name="gn" type="xs:string" use="optional"/>
<xs:attribute name="lowerRange" type="xs:decimal" use="optional"/>
<xs:attribute name="lowerRangeInclusive" type="xs:boolean" use="optional"/>
<xs:attribute name="upperRange" type="xs:decimal" use="optional"/>
<xs:attribute name="upperRangeInclusive" type="xs:boolean" use="optional"/>
<xs:attribute name="s0" type="xs:string" use="optional"/>
<xs:attribute name="n0" type="xs:decimal" use="optional"/>
<xs:attribute name="s1" type="xs:string" use="optional"/>
<xs:attribute name="n1" type="xs:decimal" use="optional"/>
<xs:attribute name="s2" type="xs:string" use="optional"/>
<xs:attribute name="n2" type="xs:decimal" use="optional"/>
<xs:attribute name="s3" type="xs:string" use="optional"/>
<xs:attribute name="n3" type="xs:decimal" use="optional"/>
<xs:attribute name="s4" type="xs:string" use="optional"/>
<xs:attribute name="n4" type="xs:decimal" use="optional"/>
</xs:complexType>
</xs:element>
-
Constructor Summary
Constructors -
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.Returns the group name for this row.Returns the lower range for this row.getOutValue(int outIndex) Returns the output value from an index.Returns the upper range for this row.booleanIndicates if the lower range is inclusive or not.booleanIndicates if the upper range is inclusive or not.booleanisValid(Vector<TierTableOutAttributeModel> outAttributes) Returns true if the tier table range is valid.voidmarshal(XMLOutputter output) Gives an XML representation of this object, including its children.booleansameGroupAs(TierTableRowModel otherRow) Returns true if both rows belong to the same group.voidsetAttributes(XMLAttributes atts) Sets the attributes of the XML representation of the element being processed.voidsetGroupName(String groupName) Sets the group name for this row.voidsetLowerRange(BigDecimal lowerRange) Sets the lower range for this row.voidsetLowerRangeInclusive(boolean inclusive) Sets if the lower range is inclusive or not.voidsetOutValue(int outIndex, Object value) Sets the output value at an index.voidsetUpperRange(BigDecimal upperRange) Sets the the upper range for this row.voidsetUpperRangeInclusive(boolean inclusive) Sets if the upper range is inclusive or not.toString()
-
Constructor Details
-
TierTableRowModel
public TierTableRowModel()Builds an empty TierTableRowModel.
-
-
Method Details
-
getGroupName
Returns the group name for this row.- Returns:
- the group name for this row
-
setGroupName
Sets the group name for this row.- Parameters:
groupName- the group name for this row
-
getLowerRange
Returns the lower range for this row.- Returns:
- the lower range for this row.
-
setLowerRange
Sets the lower range for this row.- Parameters:
lowerRange- the lower range for this row.
-
isLowerRangeInclusive
public boolean isLowerRangeInclusive()Indicates if the lower range is inclusive or not.- Returns:
- true if the lower range is inclusive.
-
setLowerRangeInclusive
public void setLowerRangeInclusive(boolean inclusive) Sets if the lower range is inclusive or not.- Parameters:
inclusive- the lower range is inclusive or not.
-
getUpperRange
Returns the upper range for this row.- Returns:
- the upper range for this row.
-
setUpperRange
Sets the the upper range for this row.- Parameters:
upperRange- the upper range for this row.
-
isUpperRangeInclusive
public boolean isUpperRangeInclusive()Indicates if the upper range is inclusive or not.- Returns:
- true if the upper range is inclusive.
-
setUpperRangeInclusive
public void setUpperRangeInclusive(boolean inclusive) Sets if the upper range is inclusive or not.- Parameters:
inclusive- the upper range is inclusive or not.
-
getOutValue
Returns the output value from an index.- Parameters:
outIndex- the index.- Returns:
- the output value at the index.
-
setOutValue
Sets the output value at an index.- Parameters:
outIndex- the index.value- the output value.
-
sameGroupAs
Returns true if both rows belong to the same group.- Parameters:
otherRow- the other row of comparison.- Returns:
- true if the tier table range is valid, false otherwise.
-
isValid
Returns true if the tier table range is valid.- Parameters:
outAttributes- a Vector ofTierTableOutAttributeModelrepresenting out attribute format.- Returns:
- true if the tier table range is valid, 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
-
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
-
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
-
toString
-