View Javadoc

1   /*
2    * Copyright 2010 Fraunhofer Gesellschaft, Munich, Germany,
3    * for its Fraunhofer Institute for Computer Architecture and Software
4    * Technology (FIRST), Berlin, Germany. All rights reserved.
5    * http://www.first.fraunhofer.de/
6    */
7   
8   package net.kwfgrid.gwes;
9   
10  import java.util.Hashtable;
11  
12  /**
13   * An activity table is an extended Hashtable with Activities as values and their corresponding
14   * activity instance identifiers as keys.
15   * @author Andreas Hoheisel
16   *         (<a href="http://www.andreas-hoheisel.de">www.andreas-hoheisel.de</a>)
17   * @version $Id: ActivityTable.java 1419 2010-11-01 14:12:17Z hoheisel $
18   */
19  public final class ActivityTable extends Hashtable<String,Activity> {
20  
21      /**
22       * Maps the specified <code>activityID</code> to the specified
23       * <code>activity</code> in this table. Neither the activityID nor the
24       * activity can be <code>null</code>. <p>
25       *
26       * @param activityID The activity identifier
27       * @param activity The activity
28       * @return     the previous activity of the specified activityID in this hashtable,
29       *             or <code>null</code> if it did not have one.
30       */
31      public final Activity put(String activityID, Activity activity) {
32          return super.put(activityID, activity);
33      }
34  
35      /**
36       * Returns the activity to which the specified activityID is mapped in this hashtable.
37       *
38       * @param   activityID   a activityID in the hashtable.
39       * @return  the activity to which the activityID is mapped in this hashtable;
40       *          <code>null</code> if the activityID is not mapped to any activity
41       *          this hashtable.
42       * @throws  NullPointerException  if the activityID is <code>null</code>.
43       * @see     #put(String, Activity)
44       */
45      public final Activity get(String activityID) {
46          return super.get(activityID);
47      }
48  
49      /**
50       * Removes the activityID (and its corresponding activity) from this
51       * hashtable. This method does nothing if the activityID is not in the hashtable.
52       *
53       * @param   activityID   the activityID that needs to be removed.
54       * @return  the activity to which the activityID had been mapped in this hashtable,
55       *          or <code>null</code> if the activityID did not have a mapping.
56       * @throws  NullPointerException  if the activityID is <code>null</code>.
57       */
58      public final Activity remove(String activityID) {
59          return super.remove(activityID);
60      }
61  
62  }