001: /**
002: *
003: */package com.bostechcorp.cbesb.common.util.etl.model;
004:
005: /**
006: * @author Administrator
007: *
008: */
009: public class CompareOperation extends AbstractOperation {
010: private ColumnElement leftOperand;
011: private ColumnElement rightOperand;
012: private CompareOperatorEnum compareOperator;
013: private String stringOperand = "";
014:
015: /**
016: *
017: */
018: public CompareOperation() {
019: super ();
020: }
021:
022: /**
023: * @param leftOperand
024: * @param rightOperand
025: * @param compareOperator
026: */
027: public CompareOperation(ColumnElement leftOperand,
028: ColumnElement rightOperand,
029: CompareOperatorEnum compareOperator) {
030: super ();
031: this .leftOperand = leftOperand;
032: this .rightOperand = rightOperand;
033: this .compareOperator = compareOperator;
034: }
035:
036: public CompareOperation(ColumnElement leftOperand,
037: String stringOperand, CompareOperatorEnum compareOperator) {
038: super ();
039: this .leftOperand = leftOperand;
040: this .stringOperand = stringOperand;
041: this .compareOperator = compareOperator;
042: }
043:
044: /* (non-Javadoc)
045: * @see com.bostechcorp.cbesb.ui.etl.model.AbstractOperation#toString()
046: */
047: @Override
048: public String toString() {
049: String displayString = "";
050: if (this .getLogicalOperator() != null)
051: displayString += this .getLogicalOperator().name() + " ";
052:
053: if (this .leftOperand != null)
054: displayString += this .leftOperand.getMap() + " ";
055: else
056: displayString += "[Left] ";
057:
058: if (this .getCompareOperator() != null)
059: displayString += this .getCompareOperator().toString() + " ";
060: else
061: displayString += "[Operator] ";
062:
063: if (this .getRightOperand() != null) {
064: displayString += this .getRightOperand().getMap() + " ";
065: } else if (!this .getStringOperand().equals("")) {
066: displayString += this .getStringOperand() + " ";
067: } else {
068: displayString += "[Right] ";
069: }
070:
071: return "Compare:" + displayString;
072: }
073:
074: public ColumnElement getLeftOperand() {
075: return leftOperand;
076: }
077:
078: public void setLeftOperand(ColumnElement leftOperand) {
079: this .leftOperand = leftOperand;
080: }
081:
082: public ColumnElement getRightOperand() {
083: return rightOperand;
084: }
085:
086: public void setRightOperand(ColumnElement rightOperand) {
087: this .rightOperand = rightOperand;
088: }
089:
090: public CompareOperatorEnum getCompareOperator() {
091: return compareOperator;
092: }
093:
094: public void setCompareOperator(CompareOperatorEnum compareOperator) {
095: this .compareOperator = compareOperator;
096: }
097:
098: /**
099: * @return the stringOperand
100: */
101: public String getStringOperand() {
102: return stringOperand;
103: }
104:
105: /**
106: * @param stringOperand the stringOperand to set
107: */
108: public void setStringOperand(String stringOperand) {
109: this.stringOperand = stringOperand;
110: }
111:
112: }
|