~tapaal-contributor/tapaal/disappearing-tokens-1940098

« back to all changes in this revision

Viewing changes to src/dk/aau/cs/model/NTA/StandardUPPAALQuery.java

  • Committer: Kenneth Yrke Jørgensen
  • Date: 2011-04-12 09:50:16 UTC
  • mfrom: (329.1.188 tapaal-1.5)
  • Revision ID: mail@yrke.dk-20110412095016-e4hqdgab5596ja09
Merged with branch addning support for new 1.5 features

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
package dk.aau.cs.TA;
 
1
package dk.aau.cs.model.NTA;
2
2
 
3
3
import java.io.PrintStream;
4
4
 
5
5
public class StandardUPPAALQuery implements UPPAALQuery {
6
6
        private String pathQuantifier;
7
7
        private String nodeQuantifier;
8
 
        
 
8
 
9
9
        private String query; // TODO: make this more object oriented
10
 
        
11
 
        public StandardUPPAALQuery(String inputQuery){ 
 
10
 
 
11
        public StandardUPPAALQuery(String inputQuery) {
12
12
                String query = inputQuery.trim();
13
 
                setPathQuantifier(query.substring(0,1));
14
 
                setNodeQuantifier(query.substring(1,3));
 
13
                setPathQuantifier(query.substring(0, 1));
 
14
                setNodeQuantifier(query.substring(1, 3));
15
15
                this.query = query.substring(3, query.length());
16
16
        }
17
 
                
18
 
        
 
17
 
19
18
        public void output(PrintStream file) {
20
19
                file.append(pathQuantifier);
21
20
                file.append(nodeQuantifier);
24
23
        }
25
24
 
26
25
        public void setPathQuantifier(String pathQuantifier) {
27
 
                if(pathQuantifier.equals("E") || pathQuantifier.equals("A")){
 
26
                if (pathQuantifier.equals("E") || pathQuantifier.equals("A")) {
28
27
                        this.pathQuantifier = pathQuantifier;
29
28
                }
30
29
        }
34
33
        }
35
34
 
36
35
        public void setNodeQuantifier(String nodeQuantifier) {
37
 
                if(nodeQuantifier.equals("<>") || nodeQuantifier.equals("[]")){
 
36
                if (nodeQuantifier.equals("<>") || nodeQuantifier.equals("[]")) {
38
37
                        this.nodeQuantifier = nodeQuantifier;
39
38
                }
40
39
        }
41
40
 
42
41
        public String getNodeQuantifier() {
43
42
                return nodeQuantifier;
44
 
        }       
 
43
        }
45
44
}