Skip to contentMethod: getHashMap()
      1: package parser.states.typestates;
2: 
3: import java.util.HashMap;
4: import java.util.Map;
5: 
6: /**
7:  * This class creates a Hashmap for POSIX character classes.
8:  * 
9:  * @author Sandra, Patrick K.
10:  * 
11:  */
12: public class PosixHashMap {
13: 
14:         /**
15:          * This attribute represents the Hashmap for POSIX character classes.
16:          */
17:         private final Map<String, String> hashMap = new HashMap<String, String>();
18: 
19:         /**
20:          * This method gives the Hashmap back.
21:          * 
22:          * @return HashMap
23:          */
24:         public Map<String, String> getHashMap() {
25:                 return this.hashMap;
26:         }
27: 
28:         /**
29:          * This is the constructor. Here the values will write in the Hashmap.
30:          */
31:         public PosixHashMap() {
32: 
33:                 this.hashMap.put("alnum", "A-Za-z0-9");
34:                 this.hashMap.put("alpha", "A-Za-z");
35:                 this.hashMap.put("blank", " \\t");
36:                 this.hashMap.put("cntrl", "\\x00-\\x1F\\x7F");
37:                 this.hashMap.put("digit", "0-9");
38:                 this.hashMap.put("graph", "\\x21-\\x7E");
39:                 this.hashMap.put("lower", "a-z");
40:                 this.hashMap.put("print", "\\x20-\\x7E");
41:                 this.hashMap.put("punct", "][!\"#$%&'()*+,./:;<=>?@^_`{|}~-");
42:                 this.hashMap.put("space", " \\t\\r\\n\\v\\f");
43:                 this.hashMap.put("upper", "A-Z");
44:                 this.hashMap.put("xdigit", "A-Fa-f0-9");
45: 
46:         }
47: }