Blame view

circus/src/jcircus/complementaryenvs/ParProcessEnv.java 1.2 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
  package jcircus.complementaryenvs;
  
  import java.util.HashMap;
  import java.util.Iterator;
  import java.util.LinkedHashMap;
  
  //@author: Samuel Lincoln M Barrocas
  	//Maps a process name to its arity: True if the process is unary, and false if n-ary, with n > 1. For example:
  		//A prefixing process is an unary process. So, it is mapped to true.
  		//Parallel, external choice and internal choice processes are binary processes, so they are mapped to false.
  public class ParProcessEnv {
  	private HashMap <String, Boolean> _map;
  	
      public ParProcessEnv () {
          this._map = new LinkedHashMap<String, Boolean>();
      }
  	public void put (String channelName, boolean b) {
  		this._map.put(channelName, b);
  	}
  	public boolean get (String channelName) {
  		return (boolean) this._map.get(channelName);
  	}
  	public HashMap <String, Boolean> getMap () {
  		return this._map;
  	}
  	public void set (String channelName, boolean b) {
  		if (this._map.containsKey(channelName)/*this.get (channelName) != (new Integer (null)).intValue()*/) {
  			this._map.remove(channelName);
  		}
  		this._map.put(channelName, b);
  	}
      public Iterator<String> iteratorKeys() {
          return this._map.keySet().iterator();
      }
  
  }