cz.cuni.jagrlib.reg
Class HashMapChannels

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

public class HashMapChannels
extends java.util.HashMap<java.lang.Integer,InfoChannel>

HashMap for channels. Into these HashMap it is posible insert only objects of InfoChannel.

See Also:
HashMapChannels.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_CHANNEL
           
static int ACTION_DELETE_CHANNEL
           
 
Constructor Summary
HashMapChannels()
           
 
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, InfoChannel _obj)
          Group change - add/remove channel.
protected  void processActionEvent(java.awt.event.ActionEvent e)
          Processes action events occurring on this object by dispatching them to any registered ActionListener objects.
 InfoChannel put(java.lang.Integer key, InfoChannel channel)
          Associates the channel with the specified key in this map.
 InfoChannel 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_CHANNEL

public static final int ACTION_DELETE_CHANNEL
See Also:
Constant Field Values

ACTION_ADD_CHANNEL

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

HashMapChannels

public HashMapChannels()
Method Detail

getMaxKey

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

Returns:
Maximum key.

put

public InfoChannel put(java.lang.Integer key,
                       InfoChannel channel)
Associates the channel 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,InfoChannel>
Overrides:
put in class java.util.HashMap<java.lang.Integer,InfoChannel>
Parameters:
key - Channel's key.
channel - Channel's info.
Returns:
previous channel 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 InfoChannel 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 - Channel's key.
Returns:
previous channel 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,
                            InfoChannel _obj)
Group change - add/remove channel.

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

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)