Class TierTableRowModel

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

public class TierTableRowModel extends 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 Details

    • TierTableRowModel

      public TierTableRowModel()
      Builds an empty TierTableRowModel.
  • Method Details

    • getGroupName

      public String getGroupName()
      Returns the group name for this row.
      Returns:
      the group name for this row
    • setGroupName

      public void setGroupName(String groupName)
      Sets the group name for this row.
      Parameters:
      groupName - the group name for this row
    • getLowerRange

      public BigDecimal getLowerRange()
      Returns the lower range for this row.
      Returns:
      the lower range for this row.
    • setLowerRange

      public void setLowerRange(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 BigDecimal getUpperRange()
      Returns the upper range for this row.
      Returns:
      the upper range for this row.
    • setUpperRange

      public void setUpperRange(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 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, 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(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(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(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 String toString()
      Overrides:
      toString in class Object