PROXY  WHOIS  RQUOTE  TEXTS  SOFT  FOREX  BBOARD
 Music  Philosophy  Code  Literature  Russian

= ROOT|Technical|Code_Examples|Java|javax|swing|ActionMap.java =

page 2 of 3



	               (Action)arrayTable.get(key);

	if (value == null) {
	    ActionMap    parent = getParent();

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

    /**
     * Removes the binding for <code>key</code> from this <code>ActionMap</code>.
     */
    public void remove(Object key) {
	if (arrayTable != null) {
	    arrayTable.remove(key);
	}
    }

    /**
     * Removes all the mappings from this <code>ActionMap</code>.
     */
    public void clear() {
	if (arrayTable != null) {
	    arrayTable.clear();
	}
    }

    /**
     * Returns the <code>Action</code> names that are bound in this <code>ActionMap</code>.
     */
    public Object[] keys() {
	if (arrayTable == null) {
	    return null;
	}
	return arrayTable.getKeys(null);
    }

    /**
     * Returns the number of <code>KeyStroke</code> bindings.
     */
    public int size() {
	if (arrayTable == null) {
	    return 0;
	}
	return arrayTable.size();
    }

    /**
     * Returns an array of the keys defined in this <code>ActionMap</code> and
     * its parent. This method differs from <code>keys()</code> in that
     * this method includes the keys defined in the parent.
     */
    public Object[] allKeys() {
	int           count = size();
	ActionMap     parent = getParent();

	if (count == 0) {
	    if (parent != null) {
		return parent.allKeys();
	    }
	    return keys();
	}
	if (parent == null) {
	    return keys();
	}
	Object[]    keys = keys();
	Object[]    pKeys =  parent.allKeys();

	if (pKeys == null) {
	    return keys;
	}
	if (keys == null) {
	    // Should only happen if size() != keys.length, which should only
	    // happen if mutated from multiple threads (or a bogus subclass).
	    return pKeys;
	}

	HashMap        keyMap = new HashMap();
	int            counter;

	for (counter = keys.length - 1; counter >= 0; counter--) {
	    keyMap.put(keys[counter], keys[counter]);
	}
	for (counter = pKeys.length - 1; counter >= 0; counter--) {
	    keyMap.put(pKeys[counter], pKeys[counter]);
	}
	return keyMap.keySet().toArray();
    }

    private void writeObject(ObjectOutputStream s) throws IOException {
        s.defaultWriteObject();

        ArrayTable.writeArrayTable(s, arrayTable);
    }

    private void readObject(ObjectInputStream s) throws ClassNotFoundException,
	                                         IOException {
=2=

1| < PREV = PAGE 2 = NEXT > |3

UP TO ROOT | UP TO DIR | TO FIRST PAGE

Google
 


E-mail Facebook Google Digg del.icio.us BlinkList Fark Furl Ma.gnolia Netscape NewsVine Reddit Slashdot Spurl StumbleUpon Technorati YahooMyWeb LiveJournal Blogmarks TwitThis Live News2.ru BobrDobr.ru Memori.ru MoeMesto.ru

0.010057 wallclock secs ( 0.01 usr + 0.00 sys = 0.01 CPU)