FileDocCategorySizeDatePackage
ResourceCache.javaAPI DocphoneME MR2 API (J2ME)2183Wed May 02 18:00:46 BST 2007com.sun.j2me.global

ResourceCache

public interface ResourceCache
Interface for Resource cache. Defines methods which resource cache must implement. For default implementation see {@link ResourceCacheLRUImpl}.

Fields Summary
Constructors Summary
Methods Summary
public booleanaddResource(Resource resource)
Add Resource into cache.

param
resource the Resource to add
return
true if call succeeded and resource was added.

public intgetHashCodeForResource(java.lang.String base, java.lang.String locale, int id)
Calculate key to resource cache. It's calculated from base name, locale, resource id.

param
base the base name
param
locale the locale
param
id the resource id
return
hash code key for resource in cache

public Resourcelookup(int hashCode)
Lookup resource in cache. Key is hashcode of the Resource calculated by {@link #getHashCodeForResource}

param
hashCode has code for resource used as key
return
resource or null if resource wasn't in cache