ArViewer  Android Version
Arvos - Augmented reality viewer open source
 All Classes Namespaces Files Functions Variables
Static Public Member Functions | Static Public Attributes | List of all members
com.mission_base.arviewer_android.ArvosCache Class Reference

Static Public Member Functions

static void initialize (Activity activity, long maxAge, long maxFiles, long maxSize)
 
static void clear ()
 
static Bitmap getBitmap (String url)
 
static void add (String url, Bitmap bitmap)
 

Static Public Attributes

static final String mExtension = ".arvos"
 

Detailed Description

Caches web files in a folder below the external cache directory or, if it is not available, below the cache directory.

Implements an LRU cache where the maximum age of files, maximum number of files and maximum number of bytes used can be specified during initialization.

Each cached item is stored in a file, the last access time stamp of the item is used as file name. Each file's first line contains the url of the cached item, the cached item itself follows after that line. The static cache instance keeps the list of cached urls and file names in memory for fast access.

Author
peter

Definition at line 57 of file ArvosCache.java.

Member Function Documentation

static void com.mission_base.arviewer_android.ArvosCache.add ( String  url,
Bitmap  bitmap 
)
static

Adds a bitmap to the cache.

Parameters
urlThe url of the bitmap to add.
bitmapThe bitmap to add.

Definition at line 360 of file ArvosCache.java.

static void com.mission_base.arviewer_android.ArvosCache.clear ( )
static

Clears the cache, deletes all cached items.

Definition at line 260 of file ArvosCache.java.

static Bitmap com.mission_base.arviewer_android.ArvosCache.getBitmap ( String  url)
static

Returns a cached bitmap or null if the bitmap is not in the cache.

Parameters
urlThe url to of the bitmap to search in the cache.
Returns
The bitmap or null.

Definition at line 298 of file ArvosCache.java.

static void com.mission_base.arviewer_android.ArvosCache.initialize ( Activity  activity,
long  maxAge,
long  maxFiles,
long  maxSize 
)
static

Initializes the static cache instance.

Parameters
activityThe activity using the cache.
maxAgeMaximum age of cached files in milliseconds.
maxFilesMaximum number of files in cache.
maxSizeMaximum total size of cache in bytes.

Definition at line 97 of file ArvosCache.java.

Member Data Documentation

final String com.mission_base.arviewer_android.ArvosCache.mExtension = ".arvos"
static

File name extension used for files in the cache.

Definition at line 65 of file ArvosCache.java.


The documentation for this class was generated from the following file: