org.epseelon.mobimap.tiles
Class TileCache

java.lang.Object
  extended by org.epseelon.mobimap.tiles.TileCache

public class TileCache
extends java.lang.Object

This class implements a very basic cache that stores a given number of map tiles at most. We need a cache that is more intelligent and more efficient.

Version:
15 juin 2008, 13:56:31
Author:
sarbogast

Constructor Summary
TileCache(int size)
          Builds a new empty cache with room ready for size tiles.
 
Method Summary
 boolean containsKey(java.lang.String url)
           
 Tile get(java.lang.String url)
          Retrieves a tile behind a given URL
 void put(java.lang.String url, Tile tile)
          Stores a tile in the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TileCache

public TileCache(int size)
Builds a new empty cache with room ready for size tiles.

Parameters:
size - The maximum number of tiles this cache will contain at any time.
Method Detail

containsKey

public boolean containsKey(java.lang.String url)
Parameters:
url - the url to check for availability
Returns:
true if there is a tile stored with this url, false otherwise

put

public void put(java.lang.String url,
                Tile tile)
Stores a tile in the cache.

Parameters:
url - The url of the tile to store
tile - The tile to store

get

public Tile get(java.lang.String url)
Retrieves a tile behind a given URL

Parameters:
url - The URL of the tile to retrieve
Returns:
The tile stored with this url if any, null otherwise


Copyright © 2008 Epseelon. All Rights Reserved.