com.highdeal.pnr.hci
Class TierTableRowModel

java.lang.Object
  extended by com.highdeal.pnr.hci.TierTableRowModel
All Implemented Interfaces:
XMLMarshallable

public class TierTableRowModel
extends java.lang.Object
implements 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
TierTableRowModel()
          Builds an empty TierTableRowModel.
 
Method Summary
 void addCharacterData(java.lang.String cData)
          Adds character data to the content element.
 void addChild(java.lang.String tagName, XMLMarshallable child)
          Adds a child to the object, the child representing the marshallable object which must be added to the element.
 java.lang.String getGroupName()
          Returns the group name for this row.
 java.math.BigDecimal getLowerRange()
          Returns the lower range for this row.
 java.lang.Object getOutValue(int outIndex)
          Returns the output value from an index.
 java.math.BigDecimal getUpperRange()
          Returns the upper range for this row.
 boolean isLowerRangeInclusive()
          Indicates if the lower range is inclusive or not.
 boolean isUpperRangeInclusive()
          Indicates if the upper range is inclusive or not.
 boolean isValid(java.util.Vector<TierTableOutAttributeModel> outAttributes)
          Returns true if the tier table range is valid.
 void marshal(XMLOutputter output)
          Gives an XML representation of this object, including its children.
 boolean sameGroupAs(TierTableRowModel otherRow)
          Returns true if both rows belong to the same group.
 void setAttributes(XMLAttributes atts)
          Sets the attributes of the XML representation of the element being processed.
 void setGroupName(java.lang.String groupName)
          Sets the group name for this row.
 void setLowerRange(java.math.BigDecimal lowerRange)
          Sets the lower range for this row.
 void setLowerRangeInclusive(boolean inclusive)
          Sets if the lower range is inclusive or not.
 void setOutValue(int outIndex, java.lang.Object value)
          Sets the output value at an index.
 void setUpperRange(java.math.BigDecimal upperRange)
          Sets the the upper range for this row.
 void setUpperRangeInclusive(boolean inclusive)
          Sets if the upper range is inclusive or not.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TierTableRowModel

public TierTableRowModel()
Builds an empty TierTableRowModel.

Method Detail

getGroupName

public java.lang.String getGroupName()
Returns the group name for this row.

Returns:
the group name for this row

setGroupName

public void setGroupName(java.lang.String groupName)
Sets the group name for this row.

Parameters:
groupName - the group name for this row

getLowerRange

public java.math.BigDecimal getLowerRange()
Returns the lower range for this row.

Returns:
the lower range for this row.

setLowerRange

public void setLowerRange(java.math.BigDecimal lowerRange)
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

public java.math.BigDecimal getUpperRange()
Returns the upper range for this row.

Returns:
the upper range for this row.

setUpperRange

public void setUpperRange(java.math.BigDecimal upperRange)
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

public java.lang.Object getOutValue(int outIndex)
Returns the output value from an index.

Parameters:
outIndex - the index.
Returns:
the output value at the index.

setOutValue

public void setOutValue(int outIndex,
                        java.lang.Object value)
Sets the output value at an index.

Parameters:
outIndex - the index.
value - the output value.

sameGroupAs

public boolean sameGroupAs(TierTableRowModel otherRow)
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

public boolean isValid(java.util.Vector<TierTableOutAttributeModel> outAttributes)
Returns true if the tier table range is valid.

Parameters:
outAttributes - a Vector of TierTableOutAttributeModel representing out attribute format.
Returns:
true if the tier table range is valid, false otherwise.

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 tagName,
                     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:
tagName - 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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

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