Interface ContainerOperation

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int getElementPosition()
      If this is an insert operation, this method returns the position in the container where the element is to be inserted (the first position is position 0).
      java.lang.String getElementSubject()
      Gets the subject of the element that this operation relates to.
      ContainerOperationType getType()
      Gets the type of the container operation, which can be an add, remove, insert or remove with prefix.
      void updateContainer​(ContainerModel model)
      If you have defined a model of the container by implementing ContainerModel, call this method from within your implementation to update the model according to the operation.
    • Method Detail

      • getType

        ContainerOperationType getType()
        Gets the type of the container operation, which can be an add, remove, insert or remove with prefix.
        Returns:
        The container operation type.
      • getElementSubject

        java.lang.String getElementSubject()

        Gets the subject of the element that this operation relates to.

         

        If this is an add, remove or insert operation, the method returns the subject of the element.

         

        If this is a remove with prefix operation, the method returns the prefix that specifies the elements to remove.

        Returns:
        The subject or prefix of the element that this operation relates to.
      • getElementPosition

        int getElementPosition()

        If this is an insert operation, this method returns the position in the container where the element is to be inserted (the first position is position 0).

         

        If this is an add, remove or remove with prefix operation, the method throws an UnsupportedOperationException.

        Returns:
        The position at which to insert the element.
        Throws:
        java.lang.UnsupportedOperationException - If this is not an insert operation.
      • updateContainer

        void updateContainer​(ContainerModel model)

        If you have defined a model of the container by implementing ContainerModel, call this method from within your implementation to update the model according to the operation. The method invokes the relevant operation callback method on the ContainerModel.

         

        For further details on how to use this method, see ContainerModel.

        Parameters:
        model - The container model that will be updated.