pivot.wtk
Class Component.ComponentDictionary

java.lang.Object
  extended by pivot.wtk.Component.ComponentDictionary
All Implemented Interfaces:
java.lang.Iterable<java.lang.Integer>, Dictionary<java.lang.Integer,Component>
Enclosing class:
Component

public static class Component.ComponentDictionary
extends java.lang.Object
implements Dictionary<java.lang.Integer,Component>, java.lang.Iterable<java.lang.Integer>

Provides dictionary access to all components by handle.

Author:
gbrown

Constructor Summary
Component.ComponentDictionary()
           
 
Method Summary
 boolean containsKey(java.lang.Integer key)
          Tests the existence of a key in the dictionary.
 Component get(java.lang.Integer key)
          Retrieves the value for the given key.
 boolean isEmpty()
          Tests the emptiness of the dictionary.
 java.util.Iterator<java.lang.Integer> iterator()
           
 Component put(java.lang.Integer key, Component value)
          Sets the value of the given key, creating a new entry or replacing the existing value.
 Component remove(java.lang.Integer key)
          Removes a key/value pair from the map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Component.ComponentDictionary

public Component.ComponentDictionary()
Method Detail

get

public Component get(java.lang.Integer key)
Description copied from interface: Dictionary
Retrieves the value for the given key.

Specified by:
get in interface Dictionary<java.lang.Integer,Component>
Parameters:
key - The key whose value is to be returned.
Returns:
The value corresponding to key, or null if the key does not exist. Will also return null if the key refers to a null value. Use containsKey() to distinguish between these two cases.

put

public Component put(java.lang.Integer key,
                     Component value)
Description copied from interface: Dictionary
Sets the value of the given key, creating a new entry or replacing the existing value.

Specified by:
put in interface Dictionary<java.lang.Integer,Component>
Parameters:
key - The key whose value is to be set.
value - The value to be associated with the given key.

remove

public Component remove(java.lang.Integer key)
Description copied from interface: Dictionary
Removes a key/value pair from the map.

Specified by:
remove in interface Dictionary<java.lang.Integer,Component>
Parameters:
key - The key whose mapping is to be removed.
Returns:
The value that was removed.

containsKey

public boolean containsKey(java.lang.Integer key)
Description copied from interface: Dictionary
Tests the existence of a key in the dictionary.

Specified by:
containsKey in interface Dictionary<java.lang.Integer,Component>
Parameters:
key - The key whose presence in the dictionary is to be tested.
Returns:
true if the key exists in the dictionary; false, otherwise.

isEmpty

public boolean isEmpty()
Description copied from interface: Dictionary
Tests the emptiness of the dictionary.

Specified by:
isEmpty in interface Dictionary<java.lang.Integer,Component>
Returns:
true if the dictionary contains no keys; false, otherwise.

iterator

public java.util.Iterator<java.lang.Integer> iterator()
Specified by:
iterator in interface java.lang.Iterable<java.lang.Integer>