com.supermap.services.util.cache

Class DefaultImageCache

  • java.lang.Object
    • com.supermap.services.util.cache.DefaultImageCache
  • All Implemented Interfaces:
    ImageCache


    public class DefaultImageCache
    extends java.lang.Object
    implements ImageCache
    

    It's used to save the generated image cache index and the files location, etc, to help quickly search relevant cache object.

    • Constructor Summary

      Constructors 
      Constructor and Description
      DefaultImageCache(java.lang.String mapName, java.lang.String outputDir) 
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void add(CacheItem item, int width, int height)
      Add cache item.
      boolean cacheExists(CacheItem cacheItem, int width, int height)
      Determine whether the corresponding cache exists
      void clear(Rectangle2D bounds)
      Clear the cache
      void clear(Rectangle2D bounds, int width, int height)
      Clear the cache
      void clearAll()
      Clear all cache.
      CacheItem[] getCacheItems(Rectangle2D bounds, double scale)
      Get the corresponding cache item according to the range and scale
      CacheItem[] getCacheItems(Rectangle2D bounds, int width, int height, double scale)
      Get the cache item in corresponding range
      void remove(CacheItem item)
      Remove the corresponding image item
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultImageCache

        public DefaultImageCache(java.lang.String mapName,
                         java.lang.String outputDir)
        
    • Method Detail

      • add

        public void add(CacheItem item,
               int width,
               int height)
        
        Description copied from interface: ImageCache

        Add cache item.

        Specified by:
        add in interface ImageCache
      • cacheExists

        public boolean cacheExists(CacheItem cacheItem,
                          int width,
                          int height)
        
        Description copied from interface: ImageCache

        Determine whether the corresponding cache exists

        Specified by:
        cacheExists in interface ImageCache
        Returns:
      • clearAll

        public void clearAll()
        
        Description copied from interface: ImageCache

        Clear all cache.

        Specified by:
        clearAll in interface ImageCache
      • remove

        public void remove(CacheItem item)
        

        Remove the corresponding image item

        Specified by:
        remove in interface ImageCache