View Javadoc

1   // Zero.java, created Jul 1, 2004 11:10:38 PM by joewhaley
2   // Copyright (C) 2004 John Whaley <jwhaley@alum.mit.edu>
3   // Licensed under the terms of the GNU LGPL; see COPYING for details.
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   * Zero
13   * 
14   * @author John Whaley
15   * @version $Id: Zero.java 328 2004-10-16 02:45:30Z joewhaley $
16   */
17  public class Zero extends HighLevelOperation {
18      Relation r0;
19  
20      /***
21       * @param r0
22       */
23      public Zero(Relation r0) {
24          super();
25          this.r0 = r0;
26      }
27  
28      /*
29       * (non-Javadoc)
30       * 
31       * @see net.sf.bddbddb.ir.Operation#visit(net.sf.bddbddb.ir.HighLevelOperationVisitor)
32       */
33      public Object visit(HighLevelOperationVisitor i) {
34          return i.visit(this);
35      }
36  
37      /*
38       * (non-Javadoc)
39       * 
40       * @see java.lang.Object#toString()
41       */
42      public String toString() {
43          return r0.toString() + " = zero()";
44      }
45  
46      /*
47       * (non-Javadoc)
48       * 
49       * @see net.sf.bddbddb.ir.Operation#getExpressionString()
50       */
51      public String getExpressionString() {
52          return "zero()";
53      }
54  
55      /*
56       * (non-Javadoc)
57       * 
58       * @see net.sf.bddbddb.ir.Operation#getDest()
59       */
60      public Relation getRelationDest() {
61          return r0;
62      }
63  
64      /*
65       * (non-Javadoc)
66       * 
67       * @see net.sf.bddbddb.ir.Operation#getSrcs()
68       */
69      public List getSrcs() {
70          return Collections.EMPTY_LIST;
71      }
72  
73      public Operation copy() {
74          return new Zero(r0);
75      }
76  
77      /*
78       * (non-Javadoc)
79       * 
80       * @see net.sf.bddbddb.ir.Operation#replaceSrc(net.sf.bddbddb.Relation,
81       *      net.sf.bddbddb.Relation)
82       */
83      public void replaceSrc(Relation r_old, Relation r_new) {
84      }
85  
86      /*
87       * (non-Javadoc)
88       * 
89       * @see net.sf.bddbddb.ir.Operation#setRelationDest(net.sf.bddbddb.Relation)
90       */
91      public void setRelationDest(Relation r0) {
92          this.r0 = r0;
93      }
94  }