# ListResourceBundle

public abstract class **ListResourceBundle** extends [ResourceBundle](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html)  
`ListResourceBundle` is an abstract subclass of
`ResourceBundle` that manages resources for a locale
in a convenient and easy to use list. 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 a pair of objects.
The first element of each pair is the key, which must be a
`String`, and the second element is the value associated with
that key.


The following example shows two members of a resource
bundle family with the base name "MyResources".
"MyResources" is the default member of the bundle family, and
"MyResources_fr" is the French member.
These members are based on `ListResourceBundle`
(a related [example](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/PropertyResourceBundle#sample) shows
how you can add a bundle to this family that's based on a properties file).
The keys in this example are of the form "s1" etc. The actual
keys are entirely up to your choice, so long as they are the same as
the keys you use in your program to retrieve the objects from the bundle.
Keys are case-sensitive.
>
> ```
>  public class MyResources extends ListResourceBundle {
>      protected Object[][] getContents() {
>          return new Object[][] {
>          // LOCALIZE THIS
>              {"s1", "The disk \"{1}\" contains {0}."},  // MessageFormat pattern
>              {"s2", "1"},                               // location of {0} in pattern
>              {"s3", "My Disk"},                         // sample disk name
>              {"s4", "no files"},                        // first ChoiceFormat choice
>              {"s5", "one file"},                        // second ChoiceFormat choice
>              {"s6", "{0,number} files"},                // third ChoiceFormat choice
>              {"s7", "3 Mar 96"},                        // sample date
>              {"s8", new Dimension(1,5)}                 // real object, not just string
>          // END OF MATERIAL TO LOCALIZE
>          };
>      }
>  }
>
>  public class MyResources_fr extends ListResourceBundle {
>      protected Object[][] getContents() {
>          return new Object[][] {
>          // LOCALIZE THIS
>              {"s1", "Le disque \"{1}\" {0}."},          // MessageFormat pattern
>              {"s2", "1"},                               // location of {0} in pattern
>              {"s3", "Mon disque"},                      // sample disk name
>              {"s4", "ne contient pas de fichiers"},     // first ChoiceFormat choice
>              {"s5", "contient un fichier"},             // second ChoiceFormat choice
>              {"s6", "contient {0,number} fichiers"},    // third ChoiceFormat choice
>              {"s7", "3 mars 1996"},                     // sample date
>              {"s8", new Dimension(1,3)}                 // real object, not just string
>          // END OF MATERIAL TO LOCALIZE
>          };
>      }
>  }
>  
> ```


The implementation of a `ListResourceBundle` subclass must be thread-safe
if it's simultaneously used by multiple threads. The default implementations
of the methods in this class are thread-safe.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/PropertyResourceBundle.html`

### Inherited Field Summary

From class [java.util.ResourceBundle](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html)

|---|---|---|
| protected [ResourceBundle](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html) | [parent](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html#parent) | The parent bundle of this bundle. |

### Public Constructor Summary

|---|---|
|   | [ListResourceBundle](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ListResourceBundle.html#ListResourceBundle())() Sole constructor. |

### Public Method Summary

|---|---|
| [Enumeration](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Enumeration.html)\<[String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)\> | [getKeys](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ListResourceBundle.html#getKeys())() Returns an `Enumeration` of the keys contained in this `ResourceBundle` and its parent bundles. |
| final [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [handleGetObject](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ListResourceBundle.html#handleGetObject(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) key) Gets an object for the given key from this resource bundle. |

### Protected Method Summary

|---|---|
| abstract [Object\[\]\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [getContents](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ListResourceBundle.html#getContents())() Returns an array in which each item is a pair of objects in an `Object` array. |
| [Set](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html)\<[String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)\> | [handleKeySet](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ListResourceBundle.html#handleKeySet())() Returns a `Set` of the keys contained *only* in this `ResourceBundle`. |

### Inherited Method Summary

From class [java.util.ResourceBundle](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html)

|---|---|
| final static void | [clearCache](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html#clearCache(java.lang.ClassLoader))([ClassLoader](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html) loader) Removes all resource bundles from the cache that have been loaded using the given class loader. |
| final static void | [clearCache](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html#clearCache())() Removes all resource bundles from the cache that have been loaded using the caller's class loader. |
| boolean | [containsKey](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html#containsKey(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) key) Determines whether the given `key` is contained in this `ResourceBundle` or its parent bundles. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getBaseBundleName](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html#getBaseBundleName())() Returns the base name of this bundle, if known, or `null` if unknown. |
| final static [ResourceBundle](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html) | [getBundle](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html#getBundle(java.lang.String,%20java.util.Locale,%20java.util.ResourceBundle.Control))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) baseName, [Locale](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Locale.html) targetLocale, [ResourceBundle.Control](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.Control.html) control) Returns a resource bundle using the specified base name, target locale and control, and the caller's class loader. |
| final static [ResourceBundle](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html) | [getBundle](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html#getBundle(java.lang.String,%20java.util.Locale))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) baseName, [Locale](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Locale.html) locale) Gets a resource bundle using the specified base name and locale, and the caller's class loader. |
| final static [ResourceBundle](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html) | [getBundle](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html#getBundle(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) baseName) Gets a resource bundle using the specified base name, the default locale, and the caller's class loader. |
| static [ResourceBundle](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html) | [getBundle](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html#getBundle(java.lang.String,%20java.util.Locale,%20java.lang.ClassLoader,%20java.util.ResourceBundle.Control))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) baseName, [Locale](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Locale.html) targetLocale, [ClassLoader](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html) loader, [ResourceBundle.Control](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.Control.html) control) Returns a resource bundle using the specified base name, target locale, class loader and control. |
| static [ResourceBundle](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html) | [getBundle](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html#getBundle(java.lang.String,%20java.util.Locale,%20java.lang.ClassLoader))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) baseName, [Locale](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Locale.html) locale, [ClassLoader](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html) loader) Gets a resource bundle using the specified base name, locale, and class loader. |
| final static [ResourceBundle](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html) | [getBundle](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html#getBundle(java.lang.String,%20java.util.ResourceBundle.Control))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) baseName, [ResourceBundle.Control](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.Control.html) control) Returns a resource bundle using the specified base name, the default locale and the specified control. |
| abstract [Enumeration](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Enumeration.html)\<[String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)\> | [getKeys](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html#getKeys())() Returns an enumeration of the keys. |
| [Locale](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Locale.html) | [getLocale](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html#getLocale())() Returns the locale of this resource bundle. |
| final [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [getObject](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html#getObject(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) key) Gets an object for the given key from this resource bundle or one of its parents. |
| final [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getString](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html#getString(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) key) Gets a string for the given key from this resource bundle or one of its parents. |
| final [String\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getStringArray](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html#getStringArray(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) key) Gets a string array for the given key from this resource bundle or one of its parents. |
| abstract [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [handleGetObject](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html#handleGetObject(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) key) Gets an object for the given key from this resource bundle. |
| [Set](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html)\<[String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)\> | [handleKeySet](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html#handleKeySet())() Returns a `Set` of the keys contained *only* in this `ResourceBundle`. |
| [Set](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html)\<[String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)\> | [keySet](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html#keySet())() Returns a `Set` of all keys contained in this `ResourceBundle` and its parent bundles. |
| void | [setParent](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html#setParent(java.util.ResourceBundle))([ResourceBundle](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html) parent) Sets the parent bundle of this bundle. |

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

## Public Constructors

#### public
**ListResourceBundle**
()

Sole constructor. (For invocation by subclass constructors, typically
implicit.)

## Public Methods

#### public [Enumeration](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Enumeration.html)\<[String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)\>
**getKeys**
()

Returns an `Enumeration` of the keys contained in
this `ResourceBundle` and its parent bundles.

##### Returns

- an `Enumeration` of the keys contained in this `ResourceBundle` and its parent bundles.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html#keySet()`

#### public final [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)
**handleGetObject**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) 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.

##### Parameters

| key | the key for the desired object |
|---|---|

##### Returns

- the object for the given key, or null

## Protected Methods

#### protected abstract [Object\[\]\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)
**getContents**
()

Returns an array in which each item is a pair of objects in an
`Object` array. The first element of each pair is
the key, which must be a `String`, and the second
element is the value associated with that key. See the class
description for details.

##### Returns

- an array of an `Object` array representing a key-value pair.

#### protected [Set](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Set.html)\<[String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)\>
**handleKeySet**
()

Returns a `Set` of the keys contained
*only* in this `ResourceBundle`.

##### Returns

- a `Set` of the keys contained only in this `ResourceBundle`

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/util/ResourceBundle.html#keySet()`