Package it.tidalwave.image.op
Class OperationImplementation<Op extends Operation,Model>
- java.lang.Object
-
- it.tidalwave.image.op.OperationImplementation<Op,Model>
-
- Direct Known Subclasses:
ApplyUnsharpMaskJ2DOp
,AssignColorProfileJ2DOp
,CaptureJ2DOp
,ChangeBufferTypeJ2DOp
,ChangeBufferTypeJ2DOp
,ConvertColorProfileJ2DOp
,ConvertToBufferedImageJ2DOp
,ConvolveJ2DOp
,CreateJ2DOp
,CropJ2DOp
,DrawJ2DOp
,HistogramJ2DOp
,OptimizeJ2DOp
,PaintJ2DOp
,PrintJ2DOp
,RotateJ2DOp
,RotateQuadrantJ2DOp
,ScaleJ2DOp
,WrapJ2DOp
,WriteJ2DOp
public abstract class OperationImplementation<Op extends Operation,Model> extends java.lang.Object
- Author:
- Fabrizio Giudici
-
-
Constructor Summary
Constructors Constructor Description OperationImplementation()
-
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.
-
-
-
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 implementmodel
- the image representation
-
-