ilog.rules.dt.model.provider

Class IlrDTAbstractDataProviderTableModel

  • All Implemented Interfaces:
    IlrDTDataProvider


    public abstract class IlrDTAbstractDataProviderTableModel
    extends IlrDTAbstractDataProvider
    An abstract class to implement an IlrDTDataProvider with an underlying table model. This class simplifies the populating process of a decision table from a tabular model.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.util.Collection getChildren(java.lang.Object object, IlrDTDefinition definition)
      Returns the child elements of the object.
      abstract int getColumnCount()
      Returns the number of columns in the model.
      java.util.Collection getObjects(IlrDTDefinition definition)
      Returns the root elements of the provided data.
      java.util.Map getProperties(java.lang.Object object, int index)
      Not used in basic use of IlrDTDataProvider.
      abstract int getRowCount()
      Returns the number of rows in the model.
      java.lang.Object getValue(java.lang.Object object, int index)
      Returns the value of the index parameter of the element object.
      abstract java.lang.Object getValueAt(int rowIndex, int columnIndex)
      Returns the value for the cell at columnIndex and rowIndex.
      boolean isColumnMergeable(int columnIndex)
      Defines whether cells in the column columnIndex of the underlying table model may be merged.
      boolean sameValueAt(int rowIndex, int columnIndex, int originRowIndex)
      Defines whether two cells of the underlying table model should be merged in the decision table model.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IlrDTAbstractDataProviderTableModel

        public IlrDTAbstractDataProviderTableModel()
    • Method Detail

      • getObjects

        public java.util.Collection getObjects(IlrDTDefinition definition)
        Description copied from interface: IlrDTDataProvider
        Returns the root elements of the provided data. These elements will be used to fill items of the decision table model according to the definition's parameter count.
        Parameters:
        definition - Indicates the number of parameters of items corresponding to the returned elements.
        Returns:
        The collection of root elements of the provided data.
        See Also:
        IlrDTDefinition.getExpressionParameterCount()
      • getChildren

        public java.util.Collection getChildren(java.lang.Object object,
                                       IlrDTDefinition definition)
        Description copied from interface: IlrDTDataProvider
        Returns the child elements of the object. These elements will be used to fill items of the decision table model according to the definition's parameter count.
        Parameters:
        object - The parent element of the returned collection of elements.
        definition - The number of parameters of items corresponding to the returned elements.
        Returns:
        The collection of root elements of the provided data.
        See Also:
        IlrDTDefinition.getExpressionParameterCount()
      • getValue

        public java.lang.Object getValue(java.lang.Object object,
                                int index)
        Description copied from interface: IlrDTDataProvider
        Returns the value of the index parameter of the element object.
        Parameters:
        object - The element corresponding to the item from the decision table model to be filled.
        index - Index of the parameter to be retrieved.
        Returns:
        A String value of the index parameter.
      • getRowCount

        public abstract int getRowCount()
        Returns the number of rows in the model. An IlrDTDataProvider uses this method to determine how many rows it should provide.
        Returns:
        the number of rows in the model.
        See Also:
        getColumnCount()
      • getColumnCount

        public abstract int getColumnCount()
        Returns the number of columns in the model. An IlrDTDataProvider uses this method to determine how many columns it should provide.
        Returns:
        the number of columns in the model.
        See Also:
        getRowCount()
      • getValueAt

        public abstract java.lang.Object getValueAt(int rowIndex,
                                  int columnIndex)
        Returns the value for the cell at columnIndex and rowIndex.
        Parameters:
        rowIndex - The row whose value is to be queried.
        columnIndex - The column whose value is to be queried.
        Returns:
        the value Object at the specified cell.
      • sameValueAt

        public boolean sameValueAt(int rowIndex,
                          int columnIndex,
                          int originRowIndex)
        Defines whether two cells of the underlying table model should be merged in the decision table model. To be coherent, if the cell at (rowIndex, columnIndex) and the cell at (originRowIndex, columnIndex) are merged, all cells between have to be merged too. In this basic implementation, two cells are merged if the value at (rowIndex, columnIndex) is null as well as all values from (rowIndex, 0) to (rowIndex, columnIndex - 1).
        Parameters:
        rowIndex - The row index.
        columnIndex - The column index.
        originRowIndex - The origin row index.
        Returns:
        true if the cell at (rowIndex, columnIndex) should be merged with the cell at (originRowIndex, columnIndex).
      • isColumnMergeable

        public boolean isColumnMergeable(int columnIndex)
        Defines whether cells in the column columnIndex of the underlying table model may be merged. This is useful to define that condition columns are mergeable and actions columns are not. In the basic implementation, all columns are mergeable.
        Parameters:
        columnIndex -
        Returns:
        the index of the column.

© Copyright IBM Corp. 1987, 2017