Blame view

circus/src/jcircus/environment/ChannelSetEnv.java 1.39 KB
8d0dc533f   Madiel de Souza Conserva Filho   first
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
  package jcircus.environment;
  
  import java.util.LinkedHashMap;
  import java.util.LinkedHashSet;
  import java.util.Map;
  import java.util.Set;
  
  /**
   * ChannelSetEnv.java
   *
   * @author Angela Freitas
   */
  public class ChannelSetEnv {
      
      /**
       * Associates the name of the channel set to a vector of names of sets
       *
       */
      private Map<String, Set<String>> _map;
      
      /**
       * Constructor.
       */
      public ChannelSetEnv() {
          _map = new LinkedHashMap<String, Set<String>>();
      }
      
      /**
       *
       * @param chanSetName
       * @param channelSet
       */
      public void insert(String chanSetName, Set<String> channelSet) {
          _map.put(chanSetName, channelSet);
      }
      
      /**
       *
       * @param chanSetName
       * @return
       */
      public Set<String> get(String chanSetName) {
          return _map.get(chanSetName);
      }
      
      /**
       * Insert a channel name in a channel set name in this collection.
       *
       * @param chanSetName
       * @param nameChannel
       */
      public void insert(String chanSetName, String chanName) {
          
          Set<String> set;
          
          if (this._map.containsKey(chanSetName))
              set = _map.get(chanSetName);
          else
              set = new LinkedHashSet<String>();
          
          set.add(chanName);
          _map.put(chanSetName, set);
      }
      
  }