类 TileCache


  • public class TileCache
    extends java.lang.Object
    An implementation only class for now. For internal use only.
    作者:
    joshua.marinacci@sun.com
    • 构造器概要

      构造器 
      构造器 说明
      TileCache()  
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      java.awt.image.BufferedImage get​(java.net.URI uri)
      Returns a buffered image for the requested URI from the cache.
      void needMoreMemory()
      Request that the cache free up some memory.
      void put​(java.net.URI uri, byte[] bimg, java.awt.image.BufferedImage img)
      Put a tile image into the cache.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • TileCache

        public TileCache()
    • 方法详细资料

      • put

        public void put​(java.net.URI uri,
                        byte[] bimg,
                        java.awt.image.BufferedImage img)
        Put a tile image into the cache. This puts both a buffered image and array of bytes that make up the compressed image.
        参数:
        uri - URI of image that is being stored in the cache
        bimg - bytes of the compressed image, ie: the image file that was loaded over the network
        img - image to store in the cache
      • get

        public java.awt.image.BufferedImage get​(java.net.URI uri)
                                         throws java.io.IOException
        Returns a buffered image for the requested URI from the cache. This method must return null if the image is not in the cache. If the image is unavailable but it's compressed version *is* available, then the compressed version will be expanded and returned.
        参数:
        uri - URI of the image previously put in the cache
        返回:
        the image matching the requested URI, or null if not available
        抛出:
        java.io.IOException
      • needMoreMemory

        public void needMoreMemory()
        Request that the cache free up some memory. How this happens or how much memory is freed is up to the TileCache implementation. Subclasses can implement their own strategy. The default strategy is to clear out all buffered images but retain the compressed versions.