Package com.helger.commons.gfx
Class ImageDataManager
- java.lang.Object
-
- com.helger.commons.gfx.ImageDataManager
-
@ThreadSafe @Singleton public final class ImageDataManager extends Object
This service class is used to cache information about images. It is used to set the HTML attributes width and height for images. It has an internal cache to avoid querying the data every time.- Author:
- Philip Helger
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EChangeclearCache()Remove all cached elementsEChangeclearCachedSize(IReadableResource aRes)Remove a single resource from the cache.ICommonsMap<IReadableResource,SizeInt>getAllCachedSizes()ICommonsSet<IReadableResource>getAllNotExistingResources()SizeIntgetImageSize(IReadableResource aRes)static ImageDataManagergetInstance()static booleanisInstantiated()
-
-
-
Method Detail
-
isInstantiated
public static boolean isInstantiated()
-
getInstance
@Nonnull public static ImageDataManager getInstance()
-
getImageSize
@Nullable public SizeInt getImageSize(@Nullable IReadableResource aRes)
-
clearCachedSize
@Nonnull public EChange clearCachedSize(@Nullable IReadableResource aRes)
Remove a single resource from the cache.- Parameters:
aRes- The resource to be removed. May benull.- Returns:
- Never
null.
-
clearCache
@Nonnull public EChange clearCache()
Remove all cached elements- Returns:
EChange- never null
-
getAllCachedSizes
@Nonnull @ReturnsMutableCopy public ICommonsMap<IReadableResource,SizeInt> getAllCachedSizes()
-
getAllNotExistingResources
@Nonnull @ReturnsMutableCopy public ICommonsSet<IReadableResource> getAllNotExistingResources()
-
-