1 10 package org.mmbase.datatypes; 11 12 19 public class FloatDataType extends NumberDataType { 20 21 private static final long serialVersionUID = 1L; 25 public FloatDataType(String name, boolean primitive) { 26 super(name, primitive ? Float.TYPE : Float .class); 27 setMin(new Float (Float.NEGATIVE_INFINITY), false); 28 setMax(new Float (Float.POSITIVE_INFINITY), false); 29 } 30 31 32 35 public float getMin() { 36 Number min = (Number ) getMinRestriction().getValue(); 37 return min == null ? Float.NEGATIVE_INFINITY : min.floatValue(); 38 } 39 40 43 public float getMax() { 44 Number max = (Number ) getMaxRestriction().getValue(); 45 return max == null ? Float.POSITIVE_INFINITY : max.floatValue(); 46 } 47 } 48 | Popular Tags |