1 10 package mondrian.olap.type; 11 12 import mondrian.olap.Util; 13 14 22 public class DecimalType extends NumericType { 23 private final int precision; 24 private final int scale; 25 26 43 public DecimalType(int precision, int scale) { 44 super(); 45 Util.assertPrecondition(precision > 0, "precision > 0"); 46 this.precision = precision; 47 this.scale = scale; 48 } 49 50 54 public int getPrecision() { 55 return precision; 56 } 57 58 61 public int getScale() { 62 return scale; 63 } 64 65 public String toString() { 66 return precision == Integer.MAX_VALUE ? 67 "DECIMAL(" + scale + ")" : 68 "DECIMAL(" + precision + ", " + scale + ")"; 69 } 70 } 71 72 | Popular Tags |