KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xquark > extractor > algebra > UnaryOperator


1 /*
2  * This file belongs to the XQuark distribution.
3  * Copyright (C) 2003 Universite de Versailles Saint-Quentin.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307.
18  * You can also get it at http://www.gnu.org/licenses/lgpl.html
19  *
20  * For more information on this software, see http://www.xquark.org.
21  */

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 JavaDoc RCSRevision = "$Revision: 1.5 $";
31     private static final String JavaDoc RCSName = "$Name: $";
32
33
34     protected Expression _operand;
35
36     /**
37     @roseuid 3B2793B4013C
38      */

39     public UnaryOperator()
40     {
41
42     }
43
44     /**
45     @param operand
46     @roseuid 3B2793910056
47      */

48     public UnaryOperator(Expression operand)
49     {
50         setOperand( operand);
51     }
52
53     synchronized Object JavaDoc clone(Map clonedExprs) throws CloneNotSupportedException JavaDoc
54     {
55         //Trace.enter(this, "clone(Map clonedExprs)");
56
UnaryOperator retVal = (UnaryOperator)super.clone(clonedExprs);
57         retVal.setOperand((getOperand () == null) ? null : (Expression) getOperand().clone (clonedExprs));
58
59         clonedExprs.put(this, retVal);
60         //Trace.exit(this, "clone(Map clonedExprs)");
61
return retVal;
62     }
63
64     /**
65     Access method for the _operand property.
66
67     @return the current value of the _operand property
68      */

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     /**
81     Sets the value of the _operand property.
82
83     @param aOperand the new value of the _operand property
84      */

85     public void setOperand(Expression aOperand)
86     {
87         _operand = aOperand;
88         _operand.setFather(this);
89     }
90
91     /**
92     @return java.util.Set
93     @roseuid 3B27939102B9
94      */

95     // change LARS 30/04/2004
96
// public Set referfedColumnExpressions()
97
// {
98
// //Trace.enter( this, "referfedColumnExpressions" );
99
// Trace.warn ( this, "referfedColumnExpressions" , "unexpected function call " );
100
// //Trace.exit ( this, "referfedColumnExpressions" );
101
// return null ;
102
// }
103

104     /**
105      * @see Expression#deepEquals(Object)
106      */

107     public boolean deepEquals(Object JavaDoc 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 /**
118
119 UnaryOperator.getOperands(){
120         ArrayList retVal = new ArrayList () ;
121         retVal.add( _operand ) ;
122         return retVal ;
123     }
124
125  */

126
Popular Tags