Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

alma::acsplugins::alarmsystem::gui::table::AlarmsContainer Class Reference

Inheritance diagram for alma::acsplugins::alarmsystem::gui::table::AlarmsContainer:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 AlarmsContainer (int max)
synchronized int size ()
synchronized void add (AlarmTableEntry entry) throws AlarmContainerException
synchronized boolean contains (String alarmID)
synchronized AlarmTableEntry get (int pos)
synchronized AlarmTableEntry get (String id)
synchronized void clear ()
synchronized AlarmTableEntry removeOldest () throws AlarmContainerException
synchronized void remove (Alarm alarm) throws AlarmContainerException
synchronized int removeInactiveAlarms (AlarmGUIType type) throws AlarmContainerException
synchronized void replace (Alarm newAlarm) throws AlarmContainerException

Private Attributes

HashMap< String, AlarmTableEntryentries = new HashMap<String AlarmTableEntry>()
final Vector< String > index = new Vector<String>()
final int maxAlarms

Detailed Description

A container for the alarms as needed by the AlarmTableModel

It is composed of 2 collections:

  1. the HashMap stores each entry accessed by its alarmID (the key)
  2. the Vector of Strings used to remember the position of each alarm when the max number of alarms has been reached It also allows to access the alarms by row
Basically the array stores the alarmID of each row in the table. The content of the row i.e. the Alarm, is then obtained by the HashMap passing the alarmID.
In this way it is possible to get the entry of a row by getting the key from the Vector. And it is possible to get an alarm from the HashMap.

Author:
acaproni


Constructor & Destructor Documentation

alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::AlarmsContainer int  max  )  [inline]
 

Build an AlarmContainer

Parameters:
max The max number of alarms to store in the container
panel The AlarmPanel


Member Function Documentation

synchronized void alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::add AlarmTableEntry  entry  )  throws AlarmContainerException [inline]
 

Add an entry (i.e a alarm) in the collection.

If there is no room available in the container, an exception is thrown. Checking if there is enough room must be done by the caller.

Parameters:
alarm The not null entry to add
Exceptions:
{@link AlarmContainerException} If the entry is already in the container

Reimplemented in alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer.

synchronized void alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::clear  )  [inline]
 

Remove all the elements in the container

Reimplemented in alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer.

synchronized boolean alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::contains String  alarmID  )  [inline]
 

Check if an alarm with the given ID is in the container

Parameters:
alarmID The ID of the alarm
Returns:
true if an entries for an alarm with the given ID exists in the container

synchronized AlarmTableEntry alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::get String  id  )  [inline]
 

Return the entry with the given ID

Parameters:
id The not null ID of the alarm in the container
Returns:
The AlarmTableEntry with the given position nullif the container does not contain an entry for the given id

synchronized AlarmTableEntry alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::get int  pos  )  [inline]
 

Return the entry in the given position

Parameters:
pos The position of the alarm in the container
reduced true if the alarms in the table are reduced
Returns:
The AlarmTableEntry in the given position

synchronized void alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::remove Alarm  alarm  )  throws AlarmContainerException [inline]
 

Remove the entry for the passed alarm

Parameters:
alarm The alarm whose entry must be removed
Exceptions:
AlarmContainerException If the alarm is not in the container

Reimplemented in alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer.

synchronized int alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::removeInactiveAlarms AlarmGUIType  type  )  throws AlarmContainerException [inline]
 

Remove all the inactive alarms of a given type.

If the type is INACTIVE all inactive alarms are deleted regardless of their priority

Parameters:
type The type of the inactive alarms
Returns:
The number of alarms removed

synchronized AlarmTableEntry alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::removeOldest  )  throws AlarmContainerException [inline]
 

Remove the oldest entry in the container

Returns:
The removed item
Exceptions:
AlarmContainerException If the container is empty

Reimplemented in alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer.

synchronized void alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::replace Alarm  newAlarm  )  throws AlarmContainerException [inline]
 

Replace the alarm in a row with passed one.

The entry to replace the alarm is given by the alarm ID of the parameter.

Parameters:
newAlarm The not null new alarm
Exceptions:
AlarmContainerException if the entry is not in the container

Reimplemented in alma::acsplugins::alarmsystem::gui::table::AlarmsReductionContainer.

synchronized int alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::size  )  [inline]
 

Return the number of alarms in the container.

Returns:
The number of alarms in the container


Member Data Documentation

HashMap<String, AlarmTableEntry> alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::entries = new HashMap<String AlarmTableEntry>() [private]
 

The entries in the table

final Vector<String> alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::index = new Vector<String>() [private]
 

The index when the reduction rules are not applied

Each item in the vector represents the ID of the entry shown in a table row when the reduction rules are not used.

final int alma::acsplugins::alarmsystem::gui::table::AlarmsContainer::maxAlarms [private]
 

The maximum number of alarms to store in the container


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 03:00:36 2009 for ACS Java API by doxygen 1.3.8