1 package jimm.datavision.source; 2 import jimm.datavision.Writeable; 3 import jimm.util.XMLWriter; 4 5 12 public class Join implements Writeable, Cloneable { 13 14 public static final String [] RELATIONS = { 15 "=", "!=", "<", "<=", ">", ">=", "like", "not like", "in", "not in" 17 }; 18 19 protected Column from; 20 protected String relation; 21 protected Column to; 22 23 32 public Join(Column fromCol, String relation, Column toCol) { 33 from = fromCol; 34 this.relation = relation; 35 to = toCol; 36 } 37 38 public Object clone() { 39 return new Join(from, relation, to); 40 } 41 42 47 public Column getFrom() { return from; } 48 49 54 public void setFrom(Column newFrom) { from = newFrom; } 55 56 62 public String getRelation() { return relation; } 63 64 69 public void setRelation(String newRelation) { relation = newRelation; } 70 71 76 public Column getTo() { return to; } 77 78 83 public void setTo(Column newTo) { to = newTo; } 84 85 89 public String toString() { 90 return from.fullName() + " " + relation + " " + to.fullName(); 91 } 92 93 98 public void writeXML(XMLWriter out) { 99 out.startElement("join"); 100 out.attr("from", from.fullName()); 101 out.attr("relation", relation); 102 out.attr("to", to.fullName()); 103 out.endElement(); 104 } 105 106 } 107 | Popular Tags |