FileDocCategorySizeDatePackage
MultiUIDefaults.javaAPI DocJava SE 5 API3827Fri Aug 26 14:57:58 BST 2005javax.swing

MultiUIDefaults

public class MultiUIDefaults extends UIDefaults
version
1.10 02/02/00
author
Hans Muller

Fields Summary
private UIDefaults[]
tables
Constructors Summary
public MultiUIDefaults(UIDefaults[] defaults)

	super();
	tables = defaults;
    
public MultiUIDefaults()

	super();
	tables = new UIDefaults[0];
    
Methods Summary
public voidclear()

	super.clear();
	for(int i = 0; i < tables.length; i++) {
	    UIDefaults table = tables[i];
	    if (table != null) {
		table.clear();
	    }
	}
    
public java.util.Enumerationelements()

	Enumeration[] enums = new Enumeration[1 + tables.length];
	enums[0] = super.elements();
	for(int i = 0; i < tables.length; i++) {
	    UIDefaults table = tables[i];
	    if (table != null) {
		enums[i + 1] = table.elements();
	    }
	}
	return new MultiUIDefaultsEnumerator(enums);
    
public java.lang.Objectget(java.lang.Object key)

	Object value = super.get(key);
	if (value != null) {
	    return value;
	}

	for(int i = 0; i < tables.length; i++) {
	    UIDefaults table = tables[i];
	    value = (table != null) ? table.get(key) : null;
	    if (value != null) {
		return value;
	    }
	}

	return null;
    
public java.lang.Objectget(java.lang.Object key, java.util.Locale l)

	Object value = super.get(key,l);
	if (value != null) {
	    return value;
	}

	for(int i = 0; i < tables.length; i++) {
	    UIDefaults table = tables[i];
	    value = (table != null) ? table.get(key,l) : null;
	    if (value != null) {
		return value;
	    }
	}

	return null;
    
protected voidgetUIError(java.lang.String msg)

        if (tables.length > 0) {
            tables[0].getUIError(msg);
        } else {
            super.getUIError(msg);
        }
    
public booleanisEmpty()

	return size() == 0;
    
public java.util.Enumerationkeys()

	Enumeration[] enums = new Enumeration[1 + tables.length];
	enums[0] = super.keys();
	for(int i = 0; i < tables.length; i++) {
	    UIDefaults table = tables[i];
	    if (table != null) {
		enums[i + 1] = table.keys();
	    }
	}
	return new MultiUIDefaultsEnumerator(enums);
    
public java.lang.Objectremove(java.lang.Object key)

	Object value = super.remove(key);
	if (value != null) {
	    return value;
	}

	for(int i = 0; i < tables.length; i++) {
	    UIDefaults table = tables[i];
	    value = (table != null) ? table.remove(key) : null;
	    if (value != null) {
		return value;
	    }
	}

	return null;
    
public intsize()

	int n = super.size();
	for(int i = 0; i < tables.length; i++) {
	    UIDefaults table = tables[i];
	    n += (table != null) ? table.size() : 0;
	}
	return n;
    
public synchronized java.lang.StringtoString()

	StringBuffer buf = new StringBuffer();
	buf.append("{");
	Enumeration keys = keys();
	while (keys.hasMoreElements()) {
	    Object key = keys.nextElement();
	    buf.append(key + "=" + get(key) + ", ");
	}
	int length = buf.length();
	if (length > 1) {
	    buf.delete(length-2, length);
	}
	buf.append("}");
	return buf.toString();