KickJava   Java API By Example, From Geeks To Geeks.

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


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 org.xquark.extractor.common.Debug;
26
27 public abstract class SqlType implements Cloneable JavaDoc
28 {
29     private static final String JavaDoc RCSRevision = "$Revision: 1.4 $";
30     private static final String JavaDoc RCSName = "$Name: $";
31
32     protected int _multiplicity = ONE;
33     public static int ONE = 1;
34     public static int MANY = 2;
35
36     public Object JavaDoc clone()
37     {
38         try {
39             return super.clone();
40         }
41         catch (CloneNotSupportedException JavaDoc ex) {
42             Debug.assertTrue(false, "error in implementation of clone");
43             return null;
44         }
45     }
46
47     /**
48     Access method for the _multiplicity property.
49
50     @return the current value of the _multiplicity property
51      */

52     public int getMultiplicity()
53     {
54         return _multiplicity;
55     }
56
57     /**
58     Sets the value of the _multiplicity property.
59
60     @param aMultiplicity the new value of the _multiplicity property
61      */

62     public void setMultiplicity(int aMultiplicity)
63     {
64         _multiplicity = aMultiplicity;
65     }
66
67     public abstract boolean isRelation();
68
69     /**
70     @return boolean
71     @roseuid 3B2786970092
72      */

73     public boolean isColumn()
74     {
75      return true;
76     }
77
78     /**
79     @return boolean
80     @roseuid 3B278A310386
81      */

82     public abstract boolean isTuple();
83
84     public abstract boolean isAtom();
85
86
87     public abstract boolean isBoolean();
88     public abstract boolean isNumeric();
89     public abstract boolean isInteger();
90     public abstract boolean isString();
91     public abstract boolean isDataTime();
92     public abstract String JavaDoc pprint ();
93
94
95     /**
96     @param type
97     @return boolean
98     @roseuid 3B27520E0141
99      */

100     public abstract boolean isCompatibleTo(SqlType type);
101     public boolean isComparableTo(SqlType type) { /** @todo */ return true;};
102 }
103
Popular Tags