Back to index

wims  3.65+svn20090927
Public Member Functions | Private Attributes
fr.ove.utils.CachingResourcesManager Class Reference

The resources manager caching the last resource required. More...

Inheritance diagram for fr.ove.utils.CachingResourcesManager:
Inheritance graph
[legend]
Collaboration diagram for fr.ove.utils.CachingResourcesManager:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CachingResourcesManager (String resourcesName)
 The Constructor.
String accessResource (String resource, int index)
 Returns the index-th resource of the specified property.
String getResourceString (String prop)
 Get the raw string for the given property.
String[] getResourceStrings (String prop)
 Get the resource strings for the given property.

Private Attributes

String cachedResource = ""
 The last resource name accessed by the instance.
String[] cachedProperties = null
 The list of properties associated to the last resource accessed by the instance.

Detailed Description

The resources manager caching the last resource required.

Author:
1999 DIRAT Laurent
Version:
2.0 17/12/1999

Definition at line 16 of file CachingResourcesManager.java.


Constructor & Destructor Documentation

The Constructor.

Parameters:
resourcesNamethe name of the resources file.

Definition at line 31 of file CachingResourcesManager.java.

                                                         {
        super(resourcesName);
    }

Member Function Documentation

String fr.ove.utils.CachingResourcesManager.accessResource ( String  resource,
int  index 
) [inline]

Returns the index-th resource of the specified property.

Parameters:
propertyNamethe name of the property
indexthe index of the resource

Definition at line 40 of file CachingResourcesManager.java.

                                                             {
        String property = null;
        
        if (!cachedResource.equals(resource)) {
            String[] properties = getResourceStrings(resource);
            if ((index >= 0) && (index < properties.length)) {
                property = properties[index];
                cachedResource = resource;
                cachedProperties = properties;
            }
        }
        else if ((index >= 0) && (index < cachedProperties.length))
            property = cachedProperties[index];
        
        return property;
        
    }

Here is the call graph for this function:

Here is the caller graph for this function:

String fr.ove.utils.ResourcesManager.getResourceString ( String  prop) [inline, inherited]

Get the raw string for the given property.

Definition at line 43 of file ResourcesManager.java.

                                                 {
        String str;
        try {
            str = resources.getString(prop);
        } 
        catch (MissingResourceException mre) {
            str = null;
        }

        return str;
    }

Here is the caller graph for this function:

String [] fr.ove.utils.ResourcesManager.getResourceStrings ( String  prop) [inline, inherited]

Get the resource strings for the given property.

Definition at line 58 of file ResourcesManager.java.

                                                     {
        return tokenize(getResourceString (prop));
    }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

The list of properties associated to the last resource accessed by the instance.

Definition at line 25 of file CachingResourcesManager.java.

The last resource name accessed by the instance.

Definition at line 20 of file CachingResourcesManager.java.


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