1 22 23 package org.xquark.extractor.algebra; 24 25 import java.util.*; 26 27 public abstract class UnaryOperator extends Expression 28 { 29 30 private static final String RCSRevision = "$Revision: 1.5 $"; 31 private static final String RCSName = "$Name: $"; 32 33 34 protected Expression _operand; 35 36 39 public UnaryOperator() 40 { 41 42 } 43 44 48 public UnaryOperator(Expression operand) 49 { 50 setOperand( operand); 51 } 52 53 synchronized Object clone(Map clonedExprs) throws CloneNotSupportedException 54 { 55 UnaryOperator retVal = (UnaryOperator)super.clone(clonedExprs); 57 retVal.setOperand((getOperand () == null) ? null : (Expression) getOperand().clone (clonedExprs)); 58 59 clonedExprs.put(this, retVal); 60 return retVal; 62 } 63 64 69 public Expression getOperand() 70 { 71 return _operand ; 72 } 73 74 public List getOperands() { 75 List retVal = new ArrayList(); 76 retVal.add(this); 77 return retVal; 78 } 79 80 85 public void setOperand(Expression aOperand) 86 { 87 _operand = aOperand; 88 _operand.setFather(this); 89 } 90 91 95 104 107 public boolean deepEquals(Object o) 108 { 109 if (o instanceof UnaryOperator) 110 { 111 UnaryOperator cast = (UnaryOperator)o; 112 return _operand.deepEquals(cast.getOperand()); 113 } 114 return false; 115 } 116 } 117 126 | Popular Tags |