Adding sypet to repo
[Benchmarks_CSolver.git] / sypet-non-incremental / src / edu / utexas / sypet / synthesis / model / JNode.java
1 /*
2  * Copyright (C) 2017 The SyPet Authors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package edu.utexas.sypet.synthesis.model;
17
18 import java.util.HashMap;
19 import java.util.LinkedHashSet;
20 import java.util.Map;
21 import java.util.Set;
22
23 public class JNode {
24
25         public int getId() {
26                 return id;
27         }
28
29         public void setId(int id) {
30                 this.id = id;
31         }
32
33         public String getType() {
34                 return type;
35         }
36
37         public void setType(String type) {
38                 this.type = type;
39         }
40
41         public String getName() {
42                 return name;
43         }
44
45         public void setName(String name) {
46                 this.name = name;
47         }
48
49         public Set<JNode> getSuccessors() {
50                 return successors;
51         }
52         
53         public Set<JNode> getPreds() {
54                 return preds;
55         }
56         
57         public void addSuccessor(JNode s) {
58                 successors.add(s);
59         }
60         
61         public void addPred(JNode s) {
62                 preds.add(s);
63         }
64
65         public void addSuccessor(JNode s, JEdge e) {
66                 outgoingEdges.put(s, e);
67                 successors.add(s);
68         }
69         
70         public JEdge getOutgoingEdges(JNode s) {
71                 return outgoingEdges.get(s);
72         }
73
74         public String toString() {
75                 return name;
76         }
77
78         protected int id;
79
80         protected String type;
81
82         protected String name;
83         
84         protected Map<JNode, JEdge> outgoingEdges = new HashMap<>();
85
86         protected Set<JNode> successors = new LinkedHashSet<>();
87         
88         protected Set<JNode> preds = new LinkedHashSet<>();
89
90
91 }