Methods Summary |
---|
protected abstract java.lang.Object[][] | getContents()Returns an {@code Object} array which contains the resources of this
{@code ListResourceBundle}. Each element in the array is an array of two
elements, the first is the resource key string and the second is the
resource.
|
public java.util.Enumeration | getKeys()Returns the names of the resources contained in this {@code ListResourceBundle}.
if (table == null) {
initializeTable();
}
if (parent == null) {
return table.keys();
}
return new Enumeration<String>() {
Enumeration<String> local = table.keys();
Enumeration<String> pEnum = parent.getKeys();
String nextElement;
private boolean findNext() {
if (nextElement != null) {
return true;
}
while (pEnum.hasMoreElements()) {
String next = pEnum.nextElement();
if (!table.containsKey(next)) {
nextElement = next;
return true;
}
}
return false;
}
public boolean hasMoreElements() {
if (local.hasMoreElements()) {
return true;
}
return findNext();
}
public String nextElement() {
if (local.hasMoreElements()) {
return local.nextElement();
}
if (findNext()) {
String result = nextElement;
nextElement = null;
return result;
}
// Cause an exception
return pEnum.nextElement();
}
};
|
public final java.lang.Object | handleGetObject(java.lang.String key)
if (table == null) {
initializeTable();
}
return table.get(key);
|
private synchronized void | initializeTable()
if (table == null) {
Object[][] contents = getContents();
table = new Hashtable<String, Object>(contents.length / 3 * 4 + 3);
for (int i = 0; i < contents.length; i++) {
table.put((String)contents[i][0], contents[i][1]);
}
}
|