Class Image
- All Implemented Interfaces:
Serializable
An image has four properties: its URL, its height, its width and its estimated quality level.
Depending of the services, the height, the width or both properties may be not known.
Implementations must use the relevant unknown constants in this case
(HEIGHT_UNKNOWN and WIDTH_UNKNOWN), to ensure properly the lack of knowledge
of one or both of these properties to extractor clients.
They should also respect the ranges defined in the estimated image resolution levels as much as possible, to ensure consistency to extractor clients.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionImage(String url, int height, int width, Image.ResolutionLevel estimatedResolutionLevel) Construct anImageinstance. -
Method Summary
-
Field Details
-
Constructor Details
-
Image
public Image(@Nonnull String url, int height, int width, @Nonnull Image.ResolutionLevel estimatedResolutionLevel) throws NullPointerException Construct anImageinstance.- Parameters:
url- the URL to the image, which should be not null or emptyheight- the image's heightwidth- the image's widthestimatedResolutionLevel- the image's estimated resolution level, which must not be null- Throws:
NullPointerException- ifestimatedResolutionLevelis null
-
-
Method Details
-
getUrl
Get the URL of thisImage.- Returns:
- the
Image's URL.
-
getHeight
public int getHeight()Get the height of thisImage.If it is unknown,
HEIGHT_UNKNOWNis returned instead.- Returns:
- the
Image's height orHEIGHT_UNKNOWN
-
getWidth
public int getWidth()Get the width of thisImage.If it is unknown,
WIDTH_UNKNOWNis returned instead.- Returns:
- the
Image's width orWIDTH_UNKNOWN
-
getEstimatedResolutionLevel
Get the estimated resolution level of this image.If it is unknown,
Image.ResolutionLevel.UNKNOWNis returned instead.- Returns:
- the estimated resolution level, which is never
null - See Also:
-
toString
Get a string representation of thisImageinstance.The representation will be in the following format, where
url,height,widthandestimatedResolutionLevelrepresent the corresponding properties:
Image {url=url, height='height, width=width, estimatedResolutionLevel=estimatedResolutionLevel}'
-