Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

oracle.ide.util
Class ArrayResourceBundle

java.lang.Object
  extended by java.util.ResourceBundle
      extended by oracle.ide.util.ArrayResourceBundle
Direct Known Subclasses:
DBIcons, ExpressionBuilderArb, ExpressionBuilderArb_en, ExpressionBuilderArb_ja, QuickDiffArb, QuickDiffArb_de, QuickDiffArb_en, QuickDiffArb_es, QuickDiffArb_fr, QuickDiffArb_it, QuickDiffArb_ja, QuickDiffArb_ko, QuickDiffArb_pt_BR, QuickDiffArb_zh_CN, QuickDiffArb_zh_TW, ResourceBundleUIArb, ResourceBundleUIArb_en, ResourceBundleUIArb_ja, RunMgrArb, RunMgrArb_de, RunMgrArb_en, RunMgrArb_es, RunMgrArb_fr, RunMgrArb_it, RunMgrArb_ja, RunMgrArb_ko, RunMgrArb_pt_BR, RunMgrArb_zh_CN, RunMgrArb_zh_TW, UIArb

public abstract class ArrayResourceBundle
extends java.util.ResourceBundle

ArrayResourceBundle is an abstract subclass of 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 ListResourceBundle and PropertyResourceBundle. See ResourceBundle for more information about resource bundles in general.

Subclasses must override getContents 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");

The following example shows the structure of a ResourceBundle based on ArrayResourceBundle.

 class MyResources extends ArrayResourceBundle {
   private 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
   };
   protected Object[] getContents() {
     return contents;
   }
 }
 

See Also:
ResourceBundle

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.ResourceBundle
java.util.ResourceBundle.Control
 
Field Summary
 
Fields inherited from class java.util.ResourceBundle
parent
 
Constructor Summary
ArrayResourceBundle()
           
 
Method Summary
 java.lang.String formatImpl(int key, java.lang.Object param1)
          Fetch a formatted String resource from the ArrayResourceBundle.
 java.lang.String formatImpl(int key, java.lang.Object[] params)
          Fetch a formatted String resource from the ArrayResourceBundle.
 java.lang.String formatImpl(int key, java.lang.Object param1, java.lang.Object param2)
          Fetch a formatted String resource from the ArrayResourceBundle.
 java.lang.String formatImpl(int key, java.lang.Object param1, java.lang.Object param2, java.lang.Object param3)
          Fetch a formatted String resource from the ArrayResourceBundle.
 javax.swing.KeyStroke getAcceleratorImpl(int key)
          Fetch a keystroke from the ArrayResourceBundle.
 char getCharImpl(int key)
          Fetch a char from the ArrayResourceBundle.
protected abstract  java.lang.Object[] getContents()
          Fetch the contents of this resource bundle.
 java.awt.Font getFontImpl(int key)
          Fetch a font from the ArrayResourceBundle.
 javax.swing.Icon getIconImpl(int key)
          Fetch an icon from the ArrayResourceBundle.
protected  javax.swing.ImageIcon getImageIconImpl(int key, boolean shouldCacheIcon)
          Fetch an ImageIcon based on a file name from the ArrayResourceBundle.
 java.awt.Image getImageImpl(int key)
          Fetch an image from the ArrayResourceBundle.
 java.lang.Integer getIntegerImpl(int key)
          Fetch an integer from the ArrayResourceBundle.
 java.util.Enumeration getKeys()
          Returns an enumeration of the keys.
 char getMnemonicImpl(int key)
          Fetch a mnemonic from the ArrayResourceBundle.
 java.lang.Object getObject(int key)
          Deprecated.  
 java.lang.Object getObjectImpl(int key)
          Get an object from an ArrayResourceBundle.
 java.lang.String[] getStringArray(int key)
          Deprecated.  
 java.lang.String getStringImpl(int key)
          Fetch a String from the ArrayResourceBundle.
 javax.swing.Icon getUncachedIconImpl(int key)
          Fetch an icon from the ArrayResourceBundle that will not be cached.
 java.awt.Image getUncachedImageImpl(int key)
          Fetch an image from the ArrayResourceBundle that will not be cached.
protected  java.lang.Object handleGetObject(java.lang.String key)
          Gets an object for the given key from this resource bundle.
 
Methods inherited from class java.util.ResourceBundle
clearCache, clearCache, containsKey, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getLocale, getObject, getString, getStringArray, handleKeySet, keySet, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayResourceBundle

public ArrayResourceBundle()
Method Detail

getStringArray

public final java.lang.String[] getStringArray(int key)
Deprecated. 

Get an object from an ArrayResourceBundle.
Convenience method to save casting.

Parameters:
key - see class description.

getObject

public final java.lang.Object getObject(int key)
Deprecated. 

Get an object from an ArrayResourceBundle.

Parameters:
key - see class description.

getStringImpl

public final java.lang.String getStringImpl(int key)
Fetch a String from the ArrayResourceBundle. This is for convenience to save casting.

Parameters:
key - index into the resource array
Returns:
the String resource

getCharImpl

public final char getCharImpl(int key)
Fetch a char from the ArrayResourceBundle.

Parameters:
key - index into the resource array
Returns:
the char resource

getFontImpl

public final java.awt.Font getFontImpl(int key)
Fetch a font from the ArrayResourceBundle.

Parameters:
key - index into the resource array
Returns:
the font resource

getAcceleratorImpl

public final javax.swing.KeyStroke getAcceleratorImpl(int key)
Fetch a keystroke from the ArrayResourceBundle.

Parameters:
key - index into the resource array
Returns:
the keystroke resource

getIntegerImpl

public final java.lang.Integer getIntegerImpl(int key)
Fetch an integer from the ArrayResourceBundle.

Parameters:
key - index into the resource array
Returns:
the integer resource

getMnemonicImpl

public final char getMnemonicImpl(int key)
Fetch a mnemonic from the ArrayResourceBundle.

Parameters:
key - index into the resource array
Returns:
the mnemonic resource

getIconImpl

public final javax.swing.Icon getIconImpl(int key)
Fetch an icon from the ArrayResourceBundle.

Parameters:
key - index into the resource array
Returns:
the icon resource

getUncachedIconImpl

public final javax.swing.Icon getUncachedIconImpl(int key)
Fetch an icon from the ArrayResourceBundle that will not be cached.

Parameters:
key - index into the resource array
Returns:
the icon resource

getImageImpl

public final java.awt.Image getImageImpl(int key)
Fetch an image from the ArrayResourceBundle.

Parameters:
key - index into the resource array
Returns:
the image resource

getUncachedImageImpl

public final java.awt.Image getUncachedImageImpl(int key)
Fetch an image from the ArrayResourceBundle that will not be cached.

Parameters:
key - index into the resource array
Returns:
the image resource

getObjectImpl

public final java.lang.Object getObjectImpl(int key)
Get an object from an ArrayResourceBundle.

Parameters:
key - index into the resource array
Returns:
the object from the resource bundle

formatImpl

public final java.lang.String formatImpl(int key,
                                         java.lang.Object[] params)
Fetch a formatted String resource from the ArrayResourceBundle. This will substitute "{n}" occurrences in the string resource with the appropriate parameter "n" from the array.

Parameters:
key - index into the resource array
params - the array of parameters.
Returns:
the formatted String resource

formatImpl

public final java.lang.String formatImpl(int key,
                                         java.lang.Object param1)
Fetch a formatted String resource from the ArrayResourceBundle.

Parameters:
key - index into the resource array
param1 - the subsitution value for {0}
Returns:
the formatted String resource

formatImpl

public final java.lang.String formatImpl(int key,
                                         java.lang.Object param1,
                                         java.lang.Object param2)
Fetch a formatted String resource from the ArrayResourceBundle.

Parameters:
key - index into the resource array
param1 - the subsitution value for {0}
param2 - the subsitution value for {1}
Returns:
the formatted String resource

formatImpl

public final java.lang.String formatImpl(int key,
                                         java.lang.Object param1,
                                         java.lang.Object param2,
                                         java.lang.Object param3)
Fetch a formatted String resource from the ArrayResourceBundle.

Parameters:
key - index into the resource array
param1 - the subsitution value for {0}
param2 - the subsitution value for {1}
param3 - the subsitution value for {2}
Returns:
the formatted String resource

getImageIconImpl

protected final javax.swing.ImageIcon getImageIconImpl(int key,
                                                       boolean shouldCacheIcon)
Fetch an ImageIcon based on a file name from the ArrayResourceBundle.

Parameters:
key - index into the resource array
shouldCacheIcon - true to cache the icon once it has been loaded
Returns:
the image icon resource

getContents

protected abstract java.lang.Object[] getContents()
Fetch the contents of this resource bundle. This is overridden by generated sub-classes to return their resources.

Returns:
the resources of the bundle as an array

getKeys

public final java.util.Enumeration getKeys()
Returns an enumeration of the keys.

Specified by:
getKeys in class java.util.ResourceBundle

handleGetObject

protected final java.lang.Object handleGetObject(java.lang.String key)
Gets an object for the given key from this resource bundle. Returns null if this resource bundle does not contain an object for the given key.

Specified by:
handleGetObject in class java.util.ResourceBundle
Parameters:
key - the key for the desired object
Returns:
the object for the given key, or null

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

Copyright © 1997, 2011, Oracle. All rights reserved.