Cramfull Compiled Resources v2.00

be.arci.cramfull
Class Cramfull

java.lang.Object
  |
  +--java.util.ResourceBundle
        |
        +--be.arci.cramfull.Cramfull

public class Cramfull
extends java.util.ResourceBundle

The abstract class Cramfull is a framework for it's subclasses to encapsulate resources in their .class-file itself. These subclasses are not coded by the application programmer, but generated and compiled by a ClassCompiler.

Being also a subclass of ResourceBundle, a generated Cramfull subclass MyCramfull can either be instantiated individualy and directly by invoking the no-args constructor as new MyCramfull() or as Class.forName("MyCramfull").newInstance(), or either be organized into a Locale hierarchy by a invoking ResourceBundle.getBundle("MyCramfull", someLocale). When loading a locale hierarchy through ResourceBundle.getBundle(), Cramfull subclasses should not be mixed with other ResourceBundle implementations; all extra functionality stops at the first non-Cramfull ResourceBundle. See java.util.ResourceBundle for more information about resource bundles in general.

Getter Methods
Cramfull offers a set of getter methods that should be used in preference to ResourceBundle.getObject(String). These getter methods retrieve resources as a byte[], as a java.io.InputStream, or as a deserialized Object, but also as the commonly used types java.awt.Image, java.applet.AudioClip and java.util.Properties. Cramfull subclasses that are organized in a locale hierarchy by ResourceBundle.getBundle("MyCramfull") can even restore a .properties file hierarchy from the contained resources in the same way as ResourceBundle.getBundle("MyProperties") would have done from the file system.

Because speed and memory usage are important when managing lots of resources, the getter methods have a retention option to enable caching a resource in the retrieved type after decoding, or removing the reference to the resource from the Cramfull that contains it. Both options enable garbage collection of the encoded resource data.

Note: Cramfull is a subclass of java.util.ResourceBundle to exploit the facilities for loading locale hierarchies. However, the following methods, which we cannot override because they are final, should not be invoked. They will either throw a typecasting error or give access to encoded resource data only:

Note: With be.arci.pub.ResourceViewer we provide a utility to view the resources contained in a Cramfull subclass. With be.arci.pub.ResourceViewer you can also list the names of these resources to the console, or extract them as normal files again.

Evaluation version

See Also:
"java.util.ResourceBundle",
ClassCompiler
,
be.arci.pub.ResourceCompiler
,
be.arci.pub.ResourceViewer
,
getByteArray(String sResource, int iRetetention)
,
getInputStream(String sResource, int iRetetention)
,
getDeserialized(String sResource, int iRetetention)
,
getProperties(String sResource, int iRetetention)
,
getLocalizedProperties(String sResource, int iRetetention)
,
getImage(String sResource, int iRetetention)
,
getAudioClip(String sResource, int iRetetention)

Field Summary
static int RET_CACHE
          Resource retention: cache the decoded resource in the retrieved format, by replacing it's encoded form in the Cramfull subclass that stored it.
static int RET_CACHE_ALL
          Resource retention: cache a decoded resource and it's parents in their respective containing Cramfull subclass as the java.util.Properties object each is loaded in.
static int RET_CACHE_AND_REMOVE_PARENTS
          Resource retention: combination of RET_CACHE and RET_REMOVE_PARENTS
static int RET_ENCODED
          Resource retention: keep encoded resource data (does nothing with the resource store, in fact).
static int RET_REMOVE
          Resource retention: remove the reference to the resource from the Cramfull subclass that stores it.
static int RET_REMOVE_ALL
          Resource retention: remove the reference to the resource from the Cramfull subclass that stores it and all it's eventual parent Cramfull-s.
static int RET_REMOVE_PARENTS
          Resource retention: remove eventual references to the resource from all parent Cramfull-s of the Cramfull subclass that stores the resource.
static java.lang.String sCopy
          Copyright notice; none of the Cramfull Compiled Resources license types allows you to change this.
 
Fields inherited from class java.util.ResourceBundle
parent
 
Constructor Summary
protected Cramfull(java.util.Hashtable htResources)
          Initializes a Cramfull subclass with a set of key-value pairs.
 
Method Summary
 java.applet.AudioClip getAudioClip(java.lang.String sResource)
          Returns an AudioClip object created from the named resource's data.
 java.applet.AudioClip getAudioClip(java.lang.String sResource, int iRetention)
          Returns an AudioClip object loaded from the named resource's data.
 byte[] getByteArray(java.lang.String sResource)
          Returns the named resource as a byte[] containing the resource's decoded data as read from the original resource file.
 byte[] getByteArray(java.lang.String sResource, int iRetention)
          Returns the named resource as a byte[] containing the resource's decoded data as read from the original resource file.
 java.lang.Object getDeserialized(java.lang.String sResource)
          Returns the named resource as an Object deserialized from the encoded resource.
 java.lang.Object getDeserialized(java.lang.String sResource, int iRetention)
          Returns the named resource as an Object deserialized from the encoded resource.
 java.awt.Image getImage(java.lang.String sResource)
          Returns an Image object created from the named resource's data.
 java.awt.Image getImage(java.lang.String sResource, int iRetention)
          Returns a Image object created from the named resource's data.
 java.io.InputStream getInputStream(java.lang.String sResource)
          Returns the named resource as an InputStream from which the resource's decoded data can be read, just as if an InputStream had been opened on the original resource file.
 java.io.InputStream getInputStream(java.lang.String sResource, int iRetention)
          Returns the named resource as an InputStream from which the resource's decoded data can be read, just as if an InputStream had been opened on the original resource file.
 java.util.Enumeration getKeys()
          Implementation of ResourceBundle.getKeys().
 java.lang.String getLocaleSuffix()
          Tries to get the locale of a Cramfull subclass by calling the Java2-added method ResourceBundle.getLocale().
 java.lang.String getLocaleSuffix(java.lang.String sResource)
          Returns the locale suffix of the first Cramfull subclass in the locale hierarchy obtained by java.util.ResourceBundle.getBundle() that contains the named resource.
 java.util.Properties getLocalizedProperties(java.lang.String sBaseName)
          Returns a Properties object for the given basename, with a locale hierarchy that reflects that of this Cramfull object and it's parents, in as far as this Cramfull object was instantiated by ResourceBundle.getBundle().
 java.util.Properties getLocalizedProperties(java.lang.String sBaseName, int iRetention)
          Returns a Properties object for the given basename, with a locale hierarchy that reflects that of this Cramfull object and it's parents, in as far as this Cramfull object was instantiated by ResourceBundle.getBundle().
 java.util.Properties getProperties(java.lang.String sResource)
          Returns a java.util.Properties object loaded from the named resource's data.
 java.util.Properties getProperties(java.lang.String sResource, int iRetention)
          Returns a java.util.Properties object loaded from the named resource's data.
 java.lang.String guessMIMEType(java.lang.String sResource)
          Tries to determine the content type of a resource, based on it's decoded data.
static java.lang.String guessMIMETypeFromName(java.lang.String sResource)
          Tries to determine the content type of a resource, based on it's name.
protected  java.lang.Object handleGetObject(java.lang.String sResource)
          Retrieves the named resource from this Cramfull's set of compiled resources, in it's encoded or cached form.
 void remove(java.lang.String sResource, boolean swRecursive)
          Remove the reference to the named resource from this Cramfull subclass or the first parent in the locale hierarchy that contains the resource.
static void setAudioClipCandidates(java.lang.String[] asAudioClipClass)
          Sets the possible java.applet.AudioClip implementations to search for.
 
Methods inherited from class java.util.ResourceBundle
getBundle, getBundle, getBundle, getLocale, getObject, getString, getStringArray, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RET_ENCODED

public static final int RET_ENCODED
Resource retention: keep encoded resource data (does nothing with the resource store, in fact).
See Also:
Getter methods

RET_CACHE

public static final int RET_CACHE
Resource retention: cache the decoded resource in the retrieved format, by replacing it's encoded form in the Cramfull subclass that stored it. This flags the encoded resource data for garbage collection.
See Also:
Getter methods

RET_REMOVE

public static final int RET_REMOVE
Resource retention: remove the reference to the resource from the Cramfull subclass that stores it. This flags the resource for garbage collection.
See Also:
Getter methods

RET_REMOVE_PARENTS

public static final int RET_REMOVE_PARENTS
Resource retention: remove eventual references to the resource from all parent Cramfull-s of the Cramfull subclass that stores the resource. This flags parent versions of the resource for garbage collection.
See Also:
Getter methods

RET_CACHE_AND_REMOVE_PARENTS

public static final int RET_CACHE_AND_REMOVE_PARENTS
Resource retention: combination of RET_CACHE and RET_REMOVE_PARENTS
See Also:
Getter methods,
RET_CACHE
,
RET_REMOVE_PARENTS

RET_REMOVE_ALL

public static final int RET_REMOVE_ALL
Resource retention: remove the reference to the resource from the Cramfull subclass that stores it and all it's eventual parent Cramfull-s. This flags the resource and parent versions of it for garbage collection.
See Also:
Getter methods,
RET_REMOVE
,
RET_REMOVE_PARENTS

RET_CACHE_ALL

public static final int RET_CACHE_ALL
Resource retention: cache a decoded resource and it's parents in their respective containing Cramfull subclass as the java.util.Properties object each is loaded in. This flags the encoded resource data and it's parents for garbage collection.

Note: This retention option applies to getLocalizedProperties only.

See Also:
Getter methods,
getLocalizedProperties(String sResource, int iRetention)

sCopy

public static final java.lang.String sCopy
Copyright notice; none of the Cramfull Compiled Resources license types allows you to change this.
Constructor Detail

Cramfull

protected Cramfull(java.util.Hashtable htResources)
Initializes a Cramfull subclass with a set of key-value pairs. Each key of htResources is a resourcename, while each value is the resource data in encoded form.
Method Detail

guessMIMETypeFromName

public static java.lang.String guessMIMETypeFromName(java.lang.String sResource)
Tries to determine the content type of a resource, based on it's name. This is a convenience method that can be used before calling one of the getter methods.

REMARK: We guess that normally the application programmer will know what the type of his resources is; this method's purpose is mainly for use by utility classes like be.arci.pub.ResourceViewer.

Note:This implementation builds on java.net.URLConntection.guessContentTypeFromName(); in some earlier JVM's this method always returns "unknown/unknown". For a list of available content types, look for files like "content-types.properties" in Sun's standard JDK distribution.

Parameters:
sResource - the (file) name of a resource
Returns:
a guess as to what the content type of the object is, based upon its file name; "unknown/unknown" if java.net.URLConntection cannot determine the content type from the resource name.
See Also:
"java.net.URLConnection.guessContentTypeFromName(String)",
guessMIMEType(String sResource)

setAudioClipCandidates

public static void setAudioClipCandidates(java.lang.String[] asAudioClipClass)
Sets the possible java.applet.AudioClip implementations to search for. The getAudioClip methods load audio resources using the first of these classes that is found and has an accessible constructor from InputStream.

Rationale: Standard Java classes can only load audioclip resources from an URL (in JDK1.1 applications, there is even no standard Java class that can load audioclip resources). In browser JVM-s we cannot define new URL protocols for opening an URL on a resource in a Cramfull subclass. Hence we have to trie diferent java.applet.AudioClip implementations to load audio resources. The current java.applet.AudioClip implementations are (in the order they are tried)

  1. "com.sun.media.sound.JavaSoundAudioClip",
  2. "sun.audio.SunAudioClip",
  3. "be.arci.applet.FallbackAudioClip"
As other implementations become available, you might prefer one or the other to try first.

Parameters:
asAudioClipClass - qualified Java class names of java.applet.AudioClip implementations to search for.
See Also:

getAudioClip(String sResource)

getLocaleSuffix

public java.lang.String getLocaleSuffix()
Tries to get the locale of a Cramfull subclass by calling the Java2-added method ResourceBundle.getLocale(). This call can fail, either because the Cramfull subclass was not loaded by ResourceBundle.getBundle() or because the JVM is at Java 1.1.x level. In that case the method defines the locale suffix as the suffix of the Cramfull subclass-name after and including the first '_' char of the class-name (ignoring an eventual leading '_' char in the class-name). If no such suffix is found, an empty String is returned.

Example:
MyCramfull_nl_BE would give the locale suffix "_nl_BE".

Returns:
the locale suffix of this Cramfull subclass.
See Also:
getLocaleSuffix(String sResource)

getLocaleSuffix

public java.lang.String getLocaleSuffix(java.lang.String sResource)
Returns the locale suffix of the first Cramfull subclass in the locale hierarchy obtained by java.util.ResourceBundle.getBundle() that contains the named resource.
Parameters:
sResource - the resource name
Returns:
the locale suffix of the first Cramfull subclass in this locale hierarchy that contains the named resource.
See Also:
getLocaleSuffix()

handleGetObject

protected final java.lang.Object handleGetObject(java.lang.String sResource)
Retrieves the named resource from this Cramfull's set of compiled resources, in it's encoded or cached form.

REMARK: This method is protected for access by java.util.ResourceBundle only. Application programmers could invoke getObject(String) instead; we recommend however to invoke the getter methods instead.

Overrides:
handleGetObject in class java.util.ResourceBundle
See Also:
"java.util.ResourceBundle.getObject(String)",
getByteArray(String sResource)
,
getInputStream(String sResource)
,
getDeserialized(String sResource)
,
getProperties(String sResource)
,
getLocalizedProperties(String sResource)
,
getImage(String sResource)
,
getAudioClip(String sResource)

getKeys

public java.util.Enumeration getKeys()
Implementation of ResourceBundle.getKeys(). If this Cramfull is obtained by ResourceBundle.getBundle(), the returned Enumeration runs over this Cramfull and all it's parents, else over this Cramfull only.

While enumerating, retrieving resources via the getter methods with any other retention than RET_ENCODED will disturb the enumeration, as the underlying collection is changed by caching or removing resources.

Overrides:
getKeys in class java.util.ResourceBundle
Returns:
an Enumeration over this Cramfull's resource names and those of it's parents.
See Also:
RET_ENCODED,
getByteArray(String sResource, int iRetention)
,
getInputStream(String sResource, int iRetention)
,
getDeserialized(String sResource)
,
getProperties(String sResource, int iRetention)
,
getImage(String sResource, int iRetention)
,
getAudioClip(String sResource, int iRetention)

guessMIMEType

public java.lang.String guessMIMEType(java.lang.String sResource)
                               throws java.util.MissingResourceException,
                                      ResourceDecodingException
Tries to determine the content type of a resource, based on it's decoded data. This is a convenience method that can be used before calling one of the getter methods.

REMARK: We guess that normally the application programmer will know what the type of his resources is; this method's purpose is mainly for use by utility classes like be.arci.pub.ResourceViewer.

If the resource is cached as Image or AudioClip object, this method will try to delegate to guessMIMETypeFromName. If that does not return an "image/..." or "audio/..." type respectively, the type "image/unknown" or "audio/unknown" is returned, without determining the exact subtype. If the resource is cached as deserialized Object, and guessMIMETypeFromName does not return a "application/..." type, the type "application/octet-stream" is returned. If the resource is cached as Properties object, and guessMIMETypeFromName does not return a "text/..." type, the self-defined type "text/properties" is returned.

If the resource is cached as InputStream, that InputStream will be reset during this call and in the next call to getInputStream().

Parameters:
sResource - the name of a resource.
Returns:
a best guess of the content type of the named resource, based upon its content data and it's name. This method returns "content/unknown" if the resource is found, but it's content type cannot be determined.
See Also:
guessMIMETypeFromName(String sResource)

getByteArray

public byte[] getByteArray(java.lang.String sResource)
                    throws java.util.MissingResourceException,
                           ResourceDecodingException
Returns the named resource as a byte[] containing the resource's decoded data as read from the original resource file.

Parameters:
sResource - the resource name
Returns:
resource's decoded data.
See Also:
getByteArray(String sResource, int iRetention)

getByteArray

public byte[] getByteArray(java.lang.String sResource,
                           int iRetention)
                    throws java.util.MissingResourceException,
                           ResourceDecodingException
Returns the named resource as a byte[] containing the resource's decoded data as read from the original resource file.

Parameters:
sResource - the resource name
iRetention - the retention option; allows optimization of memory usage and retrieval time for repeated retrieval
Returns:
resource's decoded data.
See Also:
getByteArray(String sResource),
RET_CACHE
, RET_REMOVE etcetera

getInputStream

public java.io.InputStream getInputStream(java.lang.String sResource)
                                   throws java.util.MissingResourceException,
                                          ResourceDecodingException
Returns the named resource as an InputStream from which the resource's decoded data can be read, just as if an InputStream had been opened on the original resource file.

Parameters:
sResource - the resource name
Returns:
InputStream from which the resource's decoded data can be read. If that InputStream was cached, it is reset() before this method returns.
See Also:
getInputStream(String sResource, int iRetention)

getInputStream

public java.io.InputStream getInputStream(java.lang.String sResource,
                                          int iRetention)
                                   throws java.util.MissingResourceException,
                                          ResourceDecodingException
Returns the named resource as an InputStream from which the resource's decoded data can be read, just as if an InputStream had been opened on the original resource file.

Parameters:
sResource - the resource name
iRetention - the retention option; allows optimization of memory usage and retrieval time for repeated retrieval
Returns:
InputStream from which the resource's decoded data can be read. If that InputStream was cached, it is reset() before this method returns.
See Also:
getInputStream(String sResource),
RET_CACHE
, RET_REMOVE etcetera

getDeserialized

public java.lang.Object getDeserialized(java.lang.String sResource)
                                 throws java.util.MissingResourceException,
                                        ResourceDecodingException
Returns the named resource as an Object deserialized from the encoded resource.

This method will also handle objects that where serialized individually to a file and compiled into this Cramfull subclass by ClassCompiler's addResource(CompilerEntry) method from that file. Such serialized file should:

Serialized resource files that do not follow this format, should be retrieved through getInputStream and deserialized from there by your application.

Parameters:
sResource - the resource name
Returns:
the deserialized Object.
See Also:
getDeserialized(String sResource, int iRetention),
ClassCompiler.addSerialized()

getDeserialized

public java.lang.Object getDeserialized(java.lang.String sResource,
                                        int iRetention)
                                 throws java.util.MissingResourceException,
                                        ResourceDecodingException
Returns the named resource as an Object deserialized from the encoded resource.

This method will also handle objects that where serialized individually to a file and compiled into this Cramfull subclass by ClassCompiler's addResource(CompilerEntry) method from that file. Such serialized file should:

Serialized resource files that do not follow this format, should be retrieved through getInputStream and deserialized from there by your application.

Parameters:
sResource - the resource name
iRetention - the retention option; allows optimization of memory usage and retrieval time for repeated retrieval
Returns:
the deserialized Object.
See Also:
getDeserialized(String sResource),
ClassCompiler.addSerialized()
,
RET_CACHE
, RET_REMOVE etcetera

getProperties

public java.util.Properties getProperties(java.lang.String sResource)
                                   throws java.util.MissingResourceException,
                                          ResourceDecodingException
Returns a java.util.Properties object loaded from the named resource's data.

Note: (from java.util.Properties documentation)
When loading properties from a resource, the ISO 8859-1 character encoding is used (ISO 8859-1 is also known as the Latin 1 or ANSI character set). For characters that cannot be directly represented in this encoding, Unicode escapes should be used; however, only a single 'u' character is allowed in an escape sequence. JDK's native2ascii tool can be used to convert the original .properties-files from other character encodings.

Parameters:
sResource - the resource name
Returns:
java.util.Properties object loaded from the resource's decoded data.
See Also:
"java.util.Properties.load(InputStream)",
getProperties(String sResource, int iRetention)
,
getLocalizedProperties(String sResource)

getProperties

public java.util.Properties getProperties(java.lang.String sResource,
                                          int iRetention)
                                   throws java.util.MissingResourceException,
                                          ResourceDecodingException
Returns a java.util.Properties object loaded from the named resource's data.

Note: (from java.util.Properties documentation)
When loading properties from a resource, the ISO 8859-1 character encoding is used (ISO 8859-1 is also known as the Latin 1 or ANSI character set). For characters that cannot be directly represented in this encoding, Unicode escapes should be used; however, only a single 'u' character is allowed in an escape sequence. JDK's native2ascii tool can be used to convert the original .properties-files from other character encodings.

Parameters:
sResource - the resource name
iRetention - the retention option; allows optimization of memory usage and retrieval time for repeated retrieval
Returns:
java.util.Properties object loaded from the resource's decoded data.
See Also:
"java.util.Properties.load(InputStream)",
getLocalizedProperties(String sResource, int iRetention)
,
getProperties(String sResource)
,
RET_CACHE
, RET_REMOVE etcetera

getLocalizedProperties

public java.util.Properties getLocalizedProperties(java.lang.String sBaseName)
                                            throws java.util.MissingResourceException,
                                                   ResourceDecodingException
Returns a Properties object for the given basename, with a locale hierarchy that reflects that of this Cramfull object and it's parents, in as far as this Cramfull object was instantiated by ResourceBundle.getBundle().

For example, if ResourceBundle.getBundle("MyCramfull") loaded the following locale hierarchy of Cramfull subclasses:

  • MyCramfull_fr_CH
  • MyCramfull_fr
  • MyCramfull_en_US
  • MyCramfull_en
  • MyCramfull
  • then a call to getLocalizedProperties("settings/SomeSettings") will try to load java.util.Properties objects from the resources :

  • settings/SomeSettings_fr_CH.properties
  •  from MyCramfull_fr_CH
  • settings/SomeSettings_fr.properties
  •  from MyCramfull_fr
  • settings/SomeSettings_en_US.properties
  •  from MyCramfull_en_US
  • settings/SomeSettings_en.properties
  •  from MyCramfull_en
  • settings/SomeSettings.properties
  •  from MyCramfull

    and set the defaults of each loaded java.util.Properties object to it's nearest found parent.

    Note: (from java.util.Properties documentation)
    When loading properties from a resource, the ISO 8859-1 character encoding is used (ISO 8859-1 is also known as the Latin 1 or ANSI character set). For characters that cannot be directly represented in this encoding, Unicode escapes should be used; however, only a single 'u' character is allowed in an escape sequence. JDK's native2ascii tool can be used to convert the original .properties-files from other character encodings.

    Parameters:
    sBasename - the basename for the resource hierarchy; if this name has no .properties suffix, that will be appended.
    Returns:
    Properties object loaded from the resource's decoded data.
    See Also:
    "java.util.Properties.load(InputStream)", "java.util.Properties.defaults",
    getLocalizedProperties(String sBaseName, int iRetention)
    ,
    getProperties(String sResource)
    ,
    getLocaleSuffix()

    getLocalizedProperties

    public java.util.Properties getLocalizedProperties(java.lang.String sBaseName,
                                                       int iRetention)
                                                throws java.util.MissingResourceException,
                                                       ResourceDecodingException
    Returns a Properties object for the given basename, with a locale hierarchy that reflects that of this Cramfull object and it's parents, in as far as this Cramfull object was instantiated by ResourceBundle.getBundle().

    For example, if ResourceBundle.getBundle("MyCramfull") loaded the following locale hierarchy of Cramfull subclasses:

  • MyCramfull_fr_CH
  • MyCramfull_fr
  • MyCramfull_en_US
  • MyCramfull_en
  • MyCramfull
  • then a call to getLocalizedProperties("settings/SomeSettings") will try to load java.util.Properties objects from the resources :

  • settings/SomeSettings_fr_CH.properties
  •  from MyCramfull_fr_CH
  • settings/SomeSettings_fr.properties
  •  from MyCramfull_fr
  • settings/SomeSettings_en_US.properties
  •  from MyCramfull_en_US
  • settings/SomeSettings_en.properties
  •  from MyCramfull_en
  • settings/SomeSettings.properties
  •  from MyCramfull

    and set the defaults of each loaded java.util.Properties object to it's nearest found parent.

    Note: (from java.util.Properties documentation)
    When loading properties from a resource, the ISO 8859-1 character encoding is used (ISO 8859-1 is also known as the Latin 1 or ANSI character set). For characters that cannot be directly represented in this encoding, Unicode escapes should be used; however, only a single 'u' character is allowed in an escape sequence. JDK's native2ascii tool can be used to convert the original .properties-files from other character encodings.

    Parameters:
    sBasename - the basename for the resource hierarchy; if this name has no .properties suffix, that will be appended.
    iRetention - the retention option; allows optimization of memory usage and retrieval time for repeated retrieval. This method is the only one for which the retention code RET_CACHE_ALL is allowed: the resource and each of it's localized parents in their containing Cramfull subclass will be loaded in a Properties object and cached in their respective Cramfull subclass.
    Returns:
    Properties object loaded from the resource's decoded data.
    See Also:
    "java.util.Properties.load(InputStream)", "java.util.Properties.defaults",
    getProperties(String sResource, int iRetention)
    ,
    getLocalizedProperties(String sBaseName)
    ,
    getLocaleSuffix()
    ,
    RET_CACHE
    , RET_CACHE_ALL, RET_REMOVE etcetera

    getImage

    public java.awt.Image getImage(java.lang.String sResource)
                            throws java.util.MissingResourceException,
                                   ResourceDecodingException
    Returns an Image object created from the named resource's data.

    This method creates an image from the resource data using Toolkit.getDefaultToolkit().createImage(). Toolkit.createImage() need not load the data before returning, nor check it to be valid image data. Hence the return value can be non-null, even if the named resource is not an image file.

    Parameters:
    sResource - the resource name
    Returns:
    Image object loaded from the resource's decoded data.
    See Also:
    getImage(String sResource, int iRetention)

    getImage

    public java.awt.Image getImage(java.lang.String sResource,
                                   int iRetention)
                            throws java.util.MissingResourceException,
                                   ResourceDecodingException
    Returns a Image object created from the named resource's data.

    This method creates an image from the resource data using Toolkit.getDefaultToolkit().createImage(). Toolkit.createImage() need not load the data before returning, nor check it to be valid image data. Hence the return value can be non-null, even if the named resource is not an image file.

    Parameters:
    sResource - the resource name
    iRetention - the retention option; allows optimization of memory usage and retrieval time for repeated retrieval
    Returns:
    Image object loaded from the resource's decoded data.
    See Also:
    getImage(String sResource),
    RET_CACHE
    , RET_REMOVE etcetera

    getAudioClip

    public java.applet.AudioClip getAudioClip(java.lang.String sResource)
                                       throws java.util.MissingResourceException,
                                              ResourceDecodingException
    Returns an AudioClip object created from the named resource's data.

    Parameters:
    sResource - the resource name
    Returns:
    AudioClip object loaded from the resource's decoded data.
    See Also:
    getAudioClip(String sResource, int iRetention),
    setAudioClipCandidates(String[] asAudioClipClass)

    getAudioClip

    public java.applet.AudioClip getAudioClip(java.lang.String sResource,
                                              int iRetention)
                                       throws java.util.MissingResourceException,
                                              ResourceDecodingException
    Returns an AudioClip object loaded from the named resource's data.

    Parameters:
    sResource - the resource name
    iRetention - the retention option; allows optimization of memory usage and retrieval time for repeated retrieval
    Returns:
    AudioClip object loaded from the resource's decoded data.
    See Also:
    getAudioClip(String sResource),
    setAudioClipCandidates(String[] asAudioClipClass)
    ,
    RET_CACHE
    , RET_REMOVE etcetera

    remove

    public void remove(java.lang.String sResource,
                       boolean swRecursive)
    Remove the reference to the named resource from this Cramfull subclass or the first parent in the locale hierarchy that contains the resource.

    Note: In current JVM's the memory saving of removing an encoded resource is not visible in the return value of Runtime.getRuntime().freeMemory(): as that method seems not to report about memory taken by all class constants. But the memory saving is not less real.

    Parameters:
    sResource - the resource to remove of
    swRecursive - if true, the reference to this resource is removed from the containing Cramfull subclass and it's parents (as loaded through java.util.ResourceBundle.getBundle()).
    See Also:
    RET_REMOVE, RET_REMOVE_ALL, and RET_REMOVE_PARENTS

    Cramfull Compiled Resources v2.00