1
2
3
4 package net.sf.bddbddb.ir.highlevel;
5
6 import java.util.Collections;
7 import java.util.List;
8 import jwutil.util.Assert;
9 import net.sf.bddbddb.Relation;
10 import net.sf.bddbddb.ir.Operation;
11
12 /***
13 * Free
14 *
15 * @author jwhaley
16 * @version $Id: Free.java 328 2004-10-16 02:45:30Z joewhaley $
17 */
18 public class Free extends HighLevelOperation {
19 Relation r;
20
21 /***
22 * @param r
23 */
24 public Free(Relation r) {
25 super();
26 this.r = r;
27 }
28
29
30
31
32
33
34 public Object visit(HighLevelOperationVisitor i) {
35 return i.visit(this);
36 }
37
38
39
40
41
42
43 public String toString() {
44 return "free(" + r.toString() + ")";
45 }
46
47
48
49
50
51
52 public String getExpressionString() {
53 return toString();
54 }
55
56
57
58
59
60
61 public Relation getRelationDest() {
62 return null;
63 }
64
65
66
67
68
69
70 public List getSrcs() {
71 return Collections.singletonList(r);
72 }
73
74 /***
75 * @return Returns the source relation.
76 */
77 public Relation getSrc() {
78 return r;
79 }
80
81 public Operation copy() {
82 return new Free(r);
83 }
84
85
86
87
88
89
90
91 public void replaceSrc(Relation r_old, Relation r_new) {
92 if (r == r_old) r = r_new;
93 }
94
95
96
97
98
99
100 public void setRelationDest(Relation r0) {
101 Assert.UNREACHABLE("");
102 }
103 }