1 22 23 package org.xquark.extractor.algebra; 24 25 import org.xquark.extractor.common.Debug; 26 27 public abstract class SqlType implements Cloneable 28 { 29 private static final String RCSRevision = "$Revision: 1.4 $"; 30 private static final String RCSName = "$Name: $"; 31 32 protected int _multiplicity = ONE; 33 public static int ONE = 1; 34 public static int MANY = 2; 35 36 public Object clone() 37 { 38 try { 39 return super.clone(); 40 } 41 catch (CloneNotSupportedException ex) { 42 Debug.assertTrue(false, "error in implementation of clone"); 43 return null; 44 } 45 } 46 47 52 public int getMultiplicity() 53 { 54 return _multiplicity; 55 } 56 57 62 public void setMultiplicity(int aMultiplicity) 63 { 64 _multiplicity = aMultiplicity; 65 } 66 67 public abstract boolean isRelation(); 68 69 73 public boolean isColumn() 74 { 75 return true; 76 } 77 78 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 pprint (); 93 94 95 100 public abstract boolean isCompatibleTo(SqlType type); 101 public boolean isComparableTo(SqlType type) { return true;}; 102 } 103 | Popular Tags |