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