Class AbstractImageSource<T>
- java.lang.Object
-
- net.coobird.thumbnailator.tasks.io.AbstractImageSource<T>
-
- All Implemented Interfaces:
ImageSource<T>
- Direct Known Subclasses:
BufferedImageSource,FileImageSource.UninitializedImageSource,InputStreamImageSource,URLImageSource
public abstract class AbstractImageSource<T> extends java.lang.Object implements ImageSource<T>
An abstract class forImageSources.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanhasReadInputIndicates whether the input has already been read.protected java.lang.StringinputFormatNameThe image format of the input image.protected ThumbnailParameterparamThe parameters that should be used when retrieving the image.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractImageSource()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <V> VfinishedReading(V returnValue)Indicates that theImageSourcehas completed reading the input file, and returns the value given in the argument.java.lang.StringgetInputFormatName()Returns the name of the image format.voidsetThumbnailParameter(ThumbnailParameter param)Sets theThumbnailParameterfrom which to retrieve parameters to use when retrieving the image.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.coobird.thumbnailator.tasks.io.ImageSource
getSource, read
-
-
-
-
Field Detail
-
inputFormatName
protected java.lang.String inputFormatName
The image format of the input image.
-
param
protected ThumbnailParameter param
The parameters that should be used when retrieving the image.
-
hasReadInput
protected boolean hasReadInput
Indicates whether the input has already been read.
-
-
Method Detail
-
finishedReading
protected <V> V finishedReading(V returnValue)
Indicates that theImageSourcehas completed reading the input file, and returns the value given in the argument.This method should be used by implementation classes when returning the result of the
ImageSource.read()method, as shown in the following example code:return finishedReading(sourceImage);
- Type Parameters:
V- The return value type.- Parameters:
returnValue- The return value of theImageSource.read()method.- Returns:
- The return value of the
ImageSource.read()method.
-
setThumbnailParameter
public void setThumbnailParameter(ThumbnailParameter param)
Description copied from interface:ImageSourceSets theThumbnailParameterfrom which to retrieve parameters to use when retrieving the image.- Specified by:
setThumbnailParameterin interfaceImageSource<T>- Parameters:
param- TheThumbnailParameterwith image reading parameters.
-
getInputFormatName
public java.lang.String getInputFormatName()
Description copied from interface:ImageSourceReturns the name of the image format.- Specified by:
getInputFormatNamein interfaceImageSource<T>- Returns:
- The image format name. If there is no
image format information, then
nullwill be returned.
-
-