Class RasterGeneratorBridge<T,V>
Object
org.anchoranalysis.image.io.stack.output.generator.RasterGenerator<T>
org.anchoranalysis.image.io.stack.output.generator.RasterGeneratorSelectFormat<T>
org.anchoranalysis.image.io.stack.output.generator.RasterGeneratorDelegateToRaster<V,T>
org.anchoranalysis.image.io.stack.output.generator.RasterGeneratorBridge<T,V>
- Type Parameters:
T- exposed-iterator typeV- delegate-iterator-type (hidden type)
- All Implemented Interfaces:
Generator<T>,TransformingGenerator<T,Stack>,ElementWriter<T>
public class RasterGeneratorBridge<T,V> extends RasterGeneratorDelegateToRaster<V,T>
Allows us to call an
RasterGenerator<S> as if it was an RasterGenerator<T> using
an function to connect the two.- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description RasterGeneratorBridge(RasterGenerator<V> delegate, CheckedFunction<T,V,? extends Throwable> elementBridge)Creates with a delegate and a function to bridge the exposed element-type to the delegate element-type. -
Method Summary
Modifier and Type Method Description protected VconvertBeforeAssign(T element)Converts an element before setting it on thedelegate.protected StackconvertBeforeTransform(Stack stack)Converts an element before callingRasterGeneratorDelegateToRaster.transform(T)on thedelegate.Stacktransform(T element)Methods inherited from class org.anchoranalysis.image.io.stack.output.generator.RasterGeneratorDelegateToRaster
getDelegate, guaranteedImageAttributesMethods inherited from class org.anchoranalysis.image.io.stack.output.generator.RasterGeneratorSelectFormat
selectFileExtension, writeToFileMethods inherited from class org.anchoranalysis.image.io.stack.output.generator.RasterGenerator
write, writeWithIndex
-
Constructor Details
-
RasterGeneratorBridge
public RasterGeneratorBridge(RasterGenerator<V> delegate, CheckedFunction<T,V,? extends Throwable> elementBridge)Creates with a delegate and a function to bridge the exposed element-type to the delegate element-type.- Parameters:
delegate- the delegateRasterGeneratorwhich is called after bridging.elementBridge- the function that bridges the exposed element-type to the delegate element-type.
-
-
Method Details
-
transform
- Specified by:
transformin interfaceTransformingGenerator<T,V>- Overrides:
transformin classRasterGeneratorDelegateToRaster<V,T>- Throws:
OutputWriteFailedException
-
convertBeforeAssign
Description copied from class:RasterGeneratorDelegateToRasterConverts an element before setting it on thedelegate.- Specified by:
convertBeforeAssignin classRasterGeneratorDelegateToRaster<V,T>- Parameters:
element- element to convert- Returns:
- converted element
- Throws:
OperationFailedException- if anything goes wrong during conversion
-
convertBeforeTransform
Description copied from class:RasterGeneratorDelegateToRasterConverts an element before callingRasterGeneratorDelegateToRaster.transform(T)on thedelegate.- Specified by:
convertBeforeTransformin classRasterGeneratorDelegateToRaster<V,T>- Parameters:
stack- stack to convert- Returns:
- converted element
-