borland Packages Class Hierarchy jbcl.util Package Index
java.lang.Object +----java.util.ResourceBundle +----borland.jbcl.util.ArrayResourceBundle +----borland.datastore.ResTable +----borland.jbcl.control.ResTable +----borland.jbcl.dataset.ResTable +----borland.jbcl.io.ResTable +----borland.jbcl.model.ResTable +----borland.jbcl.util.ResTable +----borland.jbcl.view.ResTable +----borland.sql.dataset.ResTable
Variables Properties MethodsThe ArrayResourceBundle is an abstract subclass of java.util.ResourceBundle that manages locale-dependent resources in an array. By using numeric references rather than string references, it requires less overhead and provides better performance than java.util.PropertyResourceBundle and java.util.ListResourceBundle
Subclasses must override the getContents() method and provide an array, where each item in the array is the resource value. The key for each resource value is its numeric offset in the array. For example, the first element in the array has the key 0. It may be retrieved by using either getObject(0) or getObject("0").
Unlike ListResourceBundle and PropertyResourceBundle, where each locale-specific variation of a bundle can override only selected resources, each variation of ArrayResourceBundle must provide the complete set of resources. For example, if the custom class MyResources has three resources, then its subclasses MyResources_ja and MyResources_fr must also have three resources.
The following example shows the structure of a ResourceBundle based on ArrayResourceBundle.
class MyResource extends ArrayResourceBundle {
public Object []getContents() {
return contents;
}
static final Object []contents = {
// LOCALIZE THIS
"Yes", // Label for the YES button
"No", // Label for the NO button
"Cancel" // Label for the CANCEL button
// END OF MATERIAL TO LOCALIZE
};
}
public Enumeration getKeys()Returns an enumeration of the keys.
Overrides: java.util.ResourceBundle.getKeys()
protected abstract Object[] getContents()See class description.
public Object getObject(int index)Gets an object from a ResourceBundle.
public final String getString(int key)Gets an object from an ArrayResourceBundle. This is a convenience method that saves the extra step of casting by returning a String.
public final String[] getStringArray(int key)Gets an object from a ResourceBundle. This is a convenience method that saves the extra step of casting by returning a String.
protected Object handleGetObject(java.lang.String key)
Overrides: java.util.ResourceBundle.handleGetObject(java.lang.String)