ilog.rules.dt.model

Interface IlrDTModel

    • Method Detail

      • addDTModelListener

        void addDTModelListener(DTModelListener l)
        Adds a structure/content listener to the IlrDTModel. This listener will be notified after notification of all previous registred listeners.
        Parameters:
        l - The listener to be added.
      • removeDTModelListener

        void removeDTModelListener(DTModelListener l)
        Removes a structure/content listener from the IlrDTModel.
        Parameters:
        l - The listener to be removed.
      • addDTModelPropertyChangeListener

        void addDTModelPropertyChangeListener(DTModelPropertyChangeListener l)
        Adds a property listener to the IlrDTModel. This listener will be notified after notification of all previous registred listeners.
        Parameters:
        l - the listener to be added
      • removeDTModelPropertyChangeListener

        void removeDTModelPropertyChangeListener(DTModelPropertyChangeListener l)
        Removes a property listener from the IlrDTModel.
        Parameters:
        l - The listener to be removed.
      • setAdjusting

        boolean setAdjusting(boolean adjusting)
        Notifies the IlrDTModel that subsequent calls to the editing methods should be treated as a single modification.
        Parameters:
        adjusting - The flag value.
        Returns:
        The previous value of the flag.
      • clear

        void clear()
        Removes all definitions, actions, partitions, and items. This method does not clear properties attached to this model.
      • clearContent

        void clearContent()
        Removes all partitions and items. This method does not remove definitions nor clear properties.
      • setPreconditionText

        void setPreconditionText(java.lang.String text)
        This method set the preconditions of this model.
        Parameters:
        text - the precondition text
      • newPartitionDefinition

        IlrDTPartitionDefinition newPartitionDefinition(java.lang.String name,
                                                      IlrDTExpression expression)
        Deprecated. : replaced by newPartitionDefinition(expression)
        Creates a new partition definition. Note that the definition is not added to the model.
        Parameters:
        name - The name of the Partition Definition to create.
        expression - The expression assigned to this definition.
        Returns:
        The new Partition Definition to be inserted in the model.
      • newPartitionDefinition

        IlrDTPartitionDefinition newPartitionDefinition(IlrDTExpressionDefinition expression)
        Creates a new partition definition. Note that the definition is not added to the model. use addPartitionDefinition() to add it to the model. Use IlrDTPopertyHelper.setDefinitionTitle() to set it a title.
        Parameters:
        expression - The expression assigned to this definition. Can be null.
        Returns:
        The new Partition Definition to be inserted in the model.
      • addPartitionDefinition

        void addPartitionDefinition(int index,
                                  IlrDTPartitionDefinition definition)
        Adds a new partition definition at the position index.
        Parameters:
        index - The position of insertion.
        definition - The new definition.
      • removePartitionDefinition

        boolean removePartitionDefinition(IlrDTPartitionDefinition definition)
        Removes a partition definition and all related partitions.
        Parameters:
        definition - The definition to be removed.
        Returns:
        true if removal was successful.
      • getPartitionDefinition

        IlrDTPartitionDefinition getPartitionDefinition(int index)
        Parameters:
        index - The index of the required partition definition.
        Returns:
        The definition at the position index.
      • indexOfPartitionDefinition

        int indexOfPartitionDefinition(IlrDTPartitionDefinition definition)
        Parameters:
        definition - The definition whose index is looked up.
        Returns:
        The index of the definition contained in the IlrDTModel, -1 otherwise.
      • getPartitionDefinitionCount

        int getPartitionDefinitionCount()
        Returns the cardinality of the Partition Definitions list.
        Returns:
        The cardinality of the Partition Definitions list.
      • setDefinitionExpression

        void setDefinitionExpression(IlrDTDefinition definition,
                                   IlrDTExpression expression)
        Assigns the given expression to the given definition, and possibly to the partition items or actions related to the definition. It also generates appropriate events.
        Parameters:
        definition - The definition to be assigned.
        expression - The expression to assign.
      • setExpression

        void setExpression(IlrDTExpressionInstanceHandler expressionHandler,
                         IlrDTExpressionInstance expression)
        Assigns the given expression to the given Expression Handler (a condition or an action, It also generates appropriate events.
        Parameters:
        expressionHandler - The condition or action to be assigned.
        expression - The expression to assign.
      • firePartitionDefinitionChanged

        void firePartitionDefinitionChanged(IlrDTPartitionDefinition definition)
        Notifies listeners that the partition definition has been modified.
        Parameters:
        definition - The modified partition definition.
      • getRoot

        IlrDTPartition getRoot()
        Returns the root partition.
        Returns:
        The root partition.
      • sortPartitions

        void sortPartitions(IlrDTPartitionDefinition definition,
                          boolean direct)
        Sorts all partitions of the given partition definition.
        Parameters:
        definition - The definition whose partitions must be sorted.
        direct - If true, sorts partitions in the direct order. If false, sorts them in reverse order.
      • sortPartition

        void sortPartition(IlrDTPartition partition,
                         boolean direct)
        Sorts the partition items of the given partition.
        Parameters:
        partition - The partition whose partition items must be sorted.
        direct - If true, sorts items in the direct order. If false, sorts them in reverse order.
      • addPartition

        IlrDTPartition addPartition(IlrDTPartitionItem item,
                                  IlrDTExpression expression)
        Inserts after the item a partition related to the definition containing a single empty item. The definition of the new partition is the next one after the item definition. If item is null, this method inserts the partition as root.
        Parameters:
        item - The parent item.
        expression - The expression used to create the item under the partition.
        Returns:
        The new partition attached to the item.
      • addPartition

        IlrDTPartition addPartition(IlrDTPartitionItem item,
                                  IlrDTPartitionDefinition definition,
                                  IlrDTExpression expression)
        Inserts after the item a partition related to the definition with a single item containing the expression. If item is null, this method inserts the partition as root.

        Note that no check is made to see if the created partition is attached to the wrong definition. On a path of the model, the order of the partitions must follow the order of the definitions.

        Parameters:
        item - The parent item.
        definition - The related definition.
        expression - The expression used to create the item under the partition.
        Returns:
        The new partition attached to the item.
      • removePartition

        boolean removePartition(IlrDTPartition partition)
        Removes the partition and all its children, then replaces it with an empty action set.
        Parameters:
        partition - The partition to be removed.
      • shrinkPartition

        boolean shrinkPartition(IlrDTPartition partition)
        Removes the partition and connects its parent item to the next statement of its only child item. If the partition has more than one item, the partition cannot be shrunk, and false is returned.
        Parameters:
        partition - The partition to be shrunk.
      • setPartitionDefinition

        boolean setPartitionDefinition(IlrDTPartition partition,
                                     IlrDTPartitionDefinition newDefinition)
        Changes the definition of a partition.
        Parameters:
        partition - The partition whose definition has to be changed.
        newDefinition - The new definition.
        Returns:
        Returns true if the change was successful, or false if the order of the partitions would not follow the order of the partition definitions after the change.
      • firePartitionChanged

        void firePartitionChanged(IlrDTPartition partition)
        Notifies listeners that the partition has changed. Generally used when the expression of the item was changed.
        Parameters:
        partition - The partition that changed.
      • addPartitionItem

        IlrDTPartitionItem addPartitionItem(IlrDTPartition partition,
                                          int index,
                                          IlrDTExpression expression)
        Inserts an item in the partition with a given expression at the position index.
        Parameters:
        partition - The parent partition.
        index - The position of insertion.
        expression - The expression attached to the partition item.
        Returns:
        The new partition item.
      • removePartitionItem

        boolean removePartitionItem(IlrDTPartitionItem item)
        Removes the partition item and the underlying branch.
        Parameters:
        item - The partition item to be removed.
        Returns:
        true if removal was successful.
      • swapPartitionItems

        boolean swapPartitionItems(IlrDTPartitionItem from,
                                 IlrDTPartitionItem to)
        Swaps the position of two partition items from the same partition.
        Parameters:
        from - The source item.
        to - The target item.
        Returns:
        true if swapping was successful.
      • firePartitionItemChanged

        void firePartitionItemChanged(IlrDTPartitionItem item)
        Notifies listeners that the partition item has been modified.
        Parameters:
        item - The modified partition item.
      • newActionDefinition

        IlrDTActionDefinition newActionDefinition(java.lang.String name,
                                                IlrDTExpression expression)
        Deprecated. : replaced by newActionDefinition(expression)
        Creates a new Action Definition. Note that this Action Definition is not added to the model.
        Parameters:
        name - The name of the new Action Definition.
        expression - The expression of the new Action Definition.
        Returns:
        The new action definition.
      • newActionDefinition

        IlrDTActionDefinition newActionDefinition(IlrDTExpressionDefinition expression)
        Creates a new Action Definition. Note that this Action Definition is not added to the model. Use addActionDefinition() method to add it to the model.Use IlrDTPropertyHelper.setDefinitionTitle() to set a title to this definition.
        Parameters:
        expression - The expression definition of the new Action Definition.
        Returns:
        The new action definition.
      • addActionDefinition

        void addActionDefinition(int index,
                               IlrDTActionDefinition definition)
        Adds a new action definition at the position index.
        Parameters:
        index - The position of insertion.
        definition - The new action definition.
      • removeActionDefinition

        boolean removeActionDefinition(IlrDTActionDefinition definition)
        Removes an action definition from the action definition list and all corresponding actions from all action sets.
        Parameters:
        definition - The action definition to be removed.
        Returns:
        true if removal was successful.
      • swapActionDefinitions

        boolean swapActionDefinitions(IlrDTActionDefinition from,
                                    IlrDTActionDefinition to)
        Swaps two action definitions in the action definitions list and indirectly corresponding actions in all action sets. Note that the order of action in actions sets is modified only if isActionAddedAutomatically() is true.
        Parameters:
        from - The source action.
        to - The target action.
        Returns:
        true if swapping was successful.
      • getActionDefinition

        IlrDTActionDefinition getActionDefinition(int index)
        Returns the action definition at the position index.
        Parameters:
        index - The position of the required action definition.
        Returns:
        The action definition at the position index.
      • indexOfActionDefinition

        int indexOfActionDefinition(IlrDTActionDefinition definition)
        Returns the index of the action definition in the IlrDTModel.
        Parameters:
        definition - The action definition whose index is looked up.
        Returns:
        The index of the action definition in the IlrDTModel.
      • getActionDefinitionCount

        int getActionDefinitionCount()
        Returns the cardinality of the action definitions list.
        Returns:
        The cardinality of the action definitions list.
      • fireActionDefinitionChanged

        void fireActionDefinitionChanged(IlrDTActionDefinition definition)
        Notifies listeners that the action definition has been modified.
        Parameters:
        definition - The modified action definition.
      • getActionSets

        java.util.List getActionSets()
        Returns the list of action sets handled by this model. The returned list should not be null and must not be modified.
        Returns:
        The list of action sets of the model.
      • getActionSet

        IlrDTActionSet getActionSet(int index)
        Returns the action set at the position index.
        Parameters:
        index - The position of the action set in the hierarchical structure.
        Returns:
        The action set at the position index.
      • indexOfActionSet

        int indexOfActionSet(IlrDTActionSet actionSet)
        Returns the index of the action set in the DTModel.
        Returns:
        The index of the action set.
      • getActionSetCount

        int getActionSetCount()
        Returns the cardinality of the action sets in the hierarchical structure.
        Returns:
        The cardinality of the action sets in the hierarchical structure.
      • removeActionSet

        boolean removeActionSet(IlrDTActionSet actionSet)
        Removes the action set and the corresponding path of partition items and partition.
        Parameters:
        actionSet - The action set to be removed.
        Returns:
        true if removal was successful.
      • fireActionSetChanged

        void fireActionSetChanged(IlrDTActionSet actionSet)
        Notifies listeners that an action set has been modified.
        Parameters:
        actionSet - The modified action set.
      • fireActionSetChanged

        void fireActionSetChanged(int firstIndex,
                                int lastIndex)
        Notifies listeners that a set of action sets from firstIndex to lastIndex have been modified.
        Parameters:
        firstIndex - The index of the first modified action set.
        lastIndex - The index of the last modified action set.
      • addAction

        IlrDTAction addAction(IlrDTActionSet actionSet,
                            int index,
                            IlrDTActionDefinition definition,
                            IlrDTExpression expression)
        Creates and adds an action in actionSet at position index, related to action definition definition, with expression expression.

        Note that if all parameters are null, a specific null action is created.

        Parameters:
        actionSet - The action set containing the created action.
        index - The position of the created action in the action set.
        definition - The definition referred to by the action.
        expression - The expression of the action.
        Returns:
        The created action.
      • removeAction

        boolean removeAction(IlrDTAction action)
        Removes an action of the IlrDTModel. Note that if isActionAddedAutomatically() is true, the action is not removed, but its expression is cleared.
        Parameters:
        action - The action to be removed/cleared.
        Returns:
        true if the operation is successful.
      • swapActions

        boolean swapActions(IlrDTAction from,
                          IlrDTAction to)
        Swaps the position of two actions within the same action set. Note that if isActionAddedAutomatically() is true, the swapping fails.
        Parameters:
        from - The first action to be swapped.
        to - The second action to be swapped.
        Returns:
        true if the operation is successful.
      • fireActionChanged

        void fireActionChanged(IlrDTAction action)
        Notifies listeners that parameters of an action in the action set have been modified. Generally called after the expression of an action has been modified.
        Parameters:
        action - The modified action.
      • fireDTModelChanged

        void fireDTModelChanged()
        Notifies listeners that the model or its environment has changed and the model has to be fully reinterpreted. Generally called after a reset() of the IlrDTModel
      • firePropertyChanged

        void firePropertyChanged(java.lang.Object property,
                               java.lang.Object oldValue,
                               java.lang.Object newValue)
        Notifies listeners that a property of the IlrDTModel has been modified.
        Parameters:
        property - The property of the IlrDTModel that was modified.
        oldValue - The value of the property before the modification.
        newValue - The value of the property after the modification.
      • fireObjectPropertyChanged

        void fireObjectPropertyChanged(IlrDTModelElement element,
                                     java.lang.Object property,
                                     java.lang.Object oldValue,
                                     java.lang.Object newValue)
        Notifies listeners that a property of an element of the IlrDTModel has been modified.
        Parameters:
        property - The property of the element of the IlrDTModel that was modified.
        oldValue - The value of the property before the modification.
        newValue - The value of the property after the modification.
      • isActionAddedAutomatically

        boolean isActionAddedAutomatically()
        Returns true if actions are automatically added and ordered according to action definitions. Generally false in the case of a table graphic representation, and true in the case of a tree graphic representation.
        Returns:
        true if actions are automatically added and ordered according to action definitions.
      • reset

        void reset()
        Reinitializes all caches attached to the model. This method drops all references to vocabulary. Generally called when the environment of the IlrDTModel changes and needs to be fully reinterpretted.
        Specified by:
        reset in interface IlrDTContext

© Copyright IBM Corp. 1987, 2017