Java in a Nutshell, 5th Edition [Electronic resources]

نسخه متنی -صفحه : 1191/ 731
نمايش فراداده

ListResourceBundlejava.util

Java 1.1

This abstract class provides a simple way to define a ResourceBundle. You may find it easier to subclass ListResourceBundle than to subclass ResourceBundle directly. ListResourceBundle provides implementations for the abstract handleGetObject( ) and getKeys( ) methods defined by ResourceBundle and adds its own abstract getContents( ) method a subclass must override. getContents( ) returns an Object[ ][ ]an array of arrays of objects. This array can have any number of elements. Each element of this array must itself be an array with two elements: the first element of each subarray should be a String that specifies the name of a resource, and the corresponding second element should be the value of that resource; this value can be an Object of any desired type. See also ResourceBundle and PropertyResourceBundle.

Figure 16-41. java.util.ListResourceBundle

public abstract class

ListResourceBundle extends ResourceBundle { // Public Constructors public

ListResourceBundle ( ); // Public Methods Overriding ResourceBundle public Enumeration<String>

getKeys ( ); public final Object

handleGetObject (String

key ); // Protected Instance Methods protected abstract Object[ ][ ]

getContents ( ); }