Class Action.NamedActionDictionary

  • All Implemented Interfaces:
    java.lang.Iterable<java.lang.String>, Dictionary<java.lang.String,​Action>
    Enclosing class:
    Action

    public static final class Action.NamedActionDictionary
    extends java.lang.Object
    implements Dictionary<java.lang.String,​Action>, java.lang.Iterable<java.lang.String>
    Action dictionary implementation.

    We wrap the underlying Map<> implementation so that only a few methods are available for use.

    • Method Detail

      • get

        public Action get​(java.lang.String actionName)
        Description copied from interface: Dictionary
        Retrieves the value for the given key.
        Specified by:
        get in interface Dictionary<java.lang.String,​Action>
        Parameters:
        actionName - 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 Dictionary.containsKey(K) to distinguish between these two cases.
      • put

        public Action put​(java.lang.String actionName,
                          Action action)
        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.String,​Action>
        Parameters:
        actionName - The key whose value is to be set.
        action - The value to be associated with the given key.
        Returns:
        The value previously associated with the key.
      • remove

        public Action remove​(java.lang.String actionName)
        Description copied from interface: Dictionary
        Removes a key/value pair from the map.
        Specified by:
        remove in interface Dictionary<java.lang.String,​Action>
        Parameters:
        actionName - The key whose mapping is to be removed.
        Returns:
        The value that was removed.
      • containsKey

        public boolean containsKey​(java.lang.String actionName)
        Description copied from interface: Dictionary
        Tests the existence of a key in the dictionary.
        Specified by:
        containsKey in interface Dictionary<java.lang.String,​Action>
        Parameters:
        actionName - The key whose presence in the dictionary is to be tested.
        Returns:
        true if the key exists in the dictionary; false, otherwise.
      • iterator

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