cz.cuni.jagrlib.reg
Class HashMapModules

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<java.lang.Integer,InfoModule>
          extended by cz.cuni.jagrlib.reg.HashMapModules
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Integer,InfoModule>

public class HashMapModules
extends java.util.HashMap<java.lang.Integer,InfoModule>

HashMap for modules and groups. Into these HashMap it is posible insert only objects of InfoModule.

See Also:
HashMapModules.java, HashMap, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Field Summary
static int ACTION_ADD_MODULE
           
static int ACTION_DELETE_MODULE
           
 
Constructor Summary
HashMapModules()
           
 
Method Summary
 void addActionListener(java.awt.event.ActionListener l)
          Adds the specified action listener to receive action events from this object.
 int getMaxKey()
          Find maximum value in set of keys contained in this map.
 void changePerformed(int id, InfoModule _obj)
          Group change - add/delete module.
protected  void processActionEvent(java.awt.event.ActionEvent e)
          Processes action events occurring on this object by dispatching them to any registered ActionListener objects.
 InfoModule put(java.lang.Integer key, InfoModule module)
          Associates the module (or group) with the specified key in this map.
 InfoModule remove(java.lang.Integer key)
          Removes the mapping for this key from this map if present.
 void removeActionListener(java.awt.event.ActionListener l)
          Removes the specified action listener so that it no longer receives action events from this object.
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

ACTION_DELETE_MODULE

public static final int ACTION_DELETE_MODULE
See Also:
Constant Field Values

ACTION_ADD_MODULE

public static final int ACTION_ADD_MODULE
See Also:
Constant Field Values
Constructor Detail

HashMapModules

public HashMapModules()
Method Detail

getMaxKey

public int getMaxKey()
Find maximum value in set of keys contained in this map.

Returns:
Maximum key.

put

public InfoModule put(java.lang.Integer key,
                      InfoModule module)
Associates the module (or group) with the specified key in this map. If the map previously contained a mapping for this key, the old value is replaced.

Specified by:
put in interface java.util.Map<java.lang.Integer,InfoModule>
Overrides:
put in class java.util.HashMap<java.lang.Integer,InfoModule>
Parameters:
key - Module's key.
module - Module's info.
Returns:
previous module associated with specified key, or null if there was no mapping for key. A null return can also indicate that the HashMap previously associated null with the specified key.

remove

public InfoModule remove(java.lang.Integer key)
Removes the mapping for this key from this map if present. If the map previously contained a mapping for this key, the old value is replaced.

Parameters:
key - Module's key.
Returns:
previous module associated with specified key, or null if there was no mapping for key. A null return can also indicate that the HashMap previously associated null with the specified key.

changePerformed

public void changePerformed(int id,
                            InfoModule _obj)
Group change - add/delete module.

Parameters:
id - Identification of action.
_obj - Module.

addActionListener

public void addActionListener(java.awt.event.ActionListener l)
Adds the specified action listener to receive action events from this object. Action events occur when any action is performed. If l is null, no exception is thrown and no action is performed.

Parameters:
l - the action listener
See Also:
removeActionListener(java.awt.event.ActionListener), ActionListener

removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)
Removes the specified action listener so that it no longer receives action events from this object. If l is null, no exception is thrown and no action is performed.

Parameters:
l - the action listener
See Also:
addActionListener(java.awt.event.ActionListener), ActionListener

processActionEvent

protected void processActionEvent(java.awt.event.ActionEvent e)
Processes action events occurring on this object by dispatching them to any registered ActionListener objects.

This method is not called unless action events are enabled for this object. Action events are enabled when one of the following occurs:

Note that if the event parameter is null the behavior is unspecified and may result in an exception.

Parameters:
e - the action event
See Also:
ActionListener, Component.enableEvents(long)