Class OperationImplementation<Op extends Operation,​Model>

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void bind​(Op operation)  
      boolean canHandle​(Op operation)
      Sometimes an implementation can't handle a specific set of parameters.
      java.lang.Object execute​(EditableImage image, java.lang.Object model)
      Executes this operation on the given model.
      protected abstract Model execute​(Op operation, EditableImage image, Model model)
      The concrete implementation of this operation should be provided by overriding this method.
      • Methods inherited from class java.lang.Object

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

      • OperationImplementation

        public OperationImplementation()
    • Method Detail

      • execute

        @Nonnull
        public final java.lang.Object execute​(@Nonnull
                                              EditableImage image,
                                              @Nonnull
                                              java.lang.Object model)
        Executes this operation on the given model.
        Parameters:
        model - the image representation
      • canHandle

        public boolean canHandle​(@Nonnull
                                 Op operation)
        Sometimes an implementation can't handle a specific set of parameters. In this case, this method must return false, so this implementation will be discarded. This method returns true by default, so subclasses with different behaviours should override it.
      • bind

        protected void bind​(@Nonnull
                            Op operation)
      • execute

        @Nonnull
        protected abstract Model execute​(@Nonnull
                                         Op operation,
                                         @Nonnull
                                         EditableImage image,
                                         @Nonnull
                                         Model model)
        The concrete implementation of this operation should be provided by overriding this method.
        Parameters:
        operation - the operation to implement
        model - the image representation