Class RangeTableColumnModel

java.lang.Object
com.highdeal.rangetable.hci.RangeTableColumnModel
All Implemented Interfaces:
IXMLMarshallable, XMLMapping, XMLMarshallable, Comparable<RangeTableColumnModel>

public class RangeTableColumnModel extends Object implements IXMLMarshallable, XMLMapping, Comparable<RangeTableColumnModel>
This Java class is a generic range table column model used by RangeTableRowModel and RangeTableRangeModel.

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:complexType name="RangeTableColumnType">
   <xs:sequence>
     <xs:choice>
       <xs:element ref="string" />
       <xs:element ref="number" />
     </xs:choice>
   </xs:sequence>
   <xs:attribute name="name" type="xs:string" use="required"/>
 </xs:complexType>

  • Field Details

  • Constructor Details

    • RangeTableColumnModel

      public RangeTableColumnModel()
  • Method Details

    • getName

      public String getName()
      Gets the name of the column.
      Returns:
      A string that contains the name of the column
    • setName

      public void setName(String name)
      Sets the name of the column.
      Parameters:
      name - The name of the column to set
    • getType

      public RangeTableColumnType getType()
      Gets the column type.
      Returns:
      The type of the column
      See Also:
    • setType

      public void setType(RangeTableColumnType newType)
      Sets the type of the column. If the type specified in parameter does not match with the internal type, then the value is set to null.
      Parameters:
      newType - The type of the column to set
      See Also:
    • getStringValue

      public String getStringValue()
      Gets the value as a String if the column type is String.
      Returns:
      The String value of the column if the type is String, null otherwise
    • setStringValue

      public void setStringValue(String value)
      Sets a String value and sets the type of the column to RangeTableClassOutColumnModel.OutRangeTableClassType.STRING.
      Parameters:
      value - The String value to set in the column.
    • getNumberValue

      public BigDecimal getNumberValue()
      Gets the value as a BigDecimal if the column type is Number.
      Returns:
      The BigDecimal value of the column if the type is Number, null otherwise
    • setNumberValue

      public void setNumberValue(BigDecimal value)
      Sets a BigDecimal value and sets the type of the column to RangeTableClassOutColumnModel.OutRangeTableClassType.SINGLE_NUMBER.
      Parameters:
      value - The BigDecimal value to set in the column
    • 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
    • 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
    • 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
    • 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
    • marshalChildren

      public void marshalChildren(XMLOutputter output)
      Description copied from interface: IXMLMarshallable
      Gives an XML representation of the child objects of an object.
      Specified by:
      marshalChildren in interface IXMLMarshallable
      Parameters:
      output - The XML output to marshal the child objects into
    • marshal

      @Deprecated public void marshal(XMLOutputter output)
      Deprecated.
      Description copied from interface: XMLMarshallable
      Gives an XML representation of this object, including its children.
      Specified by:
      marshal in interface IXMLMarshallable
      Specified by:
      marshal in interface XMLMarshallable
      Parameters:
      output - The XML output to marshal the object into
    • getClass

      public Class<?> getClass(String nsUri, String tag, XMLAttributes atts)
      Description copied from interface: XMLMapping
      Returns the Java class for a specified XML tag and its attributes in a namespace.
      Specified by:
      getClass in interface XMLMapping
      Parameters:
      nsUri - The unique resource identifier of the namespace of the XML tag
      tag - The local part of the XML tag
      atts - The attributes of the XML tag
      Returns:
      A Java class with a default constructor
    • compareTo

      public int compareTo(RangeTableColumnModel rangeTableColumnModel)
      Specified by:
      compareTo in interface Comparable<RangeTableColumnModel>