Update of /var/cvs/src/org/mmbase/datatypes
In directory james.mmbase.org:/tmp/cvs-serv18672

Modified Files:
        DecimalDataType.java 
Log Message:
javadoc


See also: http://cvs.mmbase.org/viewcvs/src/org/mmbase/datatypes


Index: DecimalDataType.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/datatypes/DecimalDataType.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- DecimalDataType.java        1 Dec 2008 17:24:14 -0000       1.1
+++ DecimalDataType.java        1 Dec 2008 17:50:51 -0000       1.2
@@ -18,10 +18,25 @@
 import org.mmbase.util.logging.Logging;
 
 /**
- * DataType associated with [EMAIL PROTECTED] java.math.BigDecimal}, a 
NumberDataType, but provides getMin and getMax as int.
+ * DataType associated with [EMAIL PROTECTED] java.math.BigDecimal}, a 
NumberDataType. Decimals are naturally
+ * restricted on [EMAIL PROTECTED] BigDecimal#precision()} and [EMAIL 
PROTECTED] BigDecimal#scale()}.
+ *
+ * The <em>precision</em> of a decimal can be identified with its 
<em>length</em>, because it is simply the
+ * number of stored digits. Therefore this class <em>does</em>, in 
contradication to other
+ * NumberDataTypes implement [EMAIL PROTECTED] LengthDataType}. [EMAIL 
PROTECTED] #getPrecision} and [EMAIL PROTECTED]
+ * #getMaxLength} are synonymous though.
+ *
+ * The precision and scale properties correspond with the xsd-tags 
xsd:precision and xsd:scale,
+ * indicating <em>maximal</em> values for those concepts. The can be set with 
dt:precision
+ * (dt:maxLength should work too) and dt:scale.
+ *
+ * The rounding mode is used, and must be relaxed (since it is default [EMAIL 
PROTECTED]
+ * RoundingMode#UNNECESSARY}), if the scale restriction is not enforced. In 
this case the values can
+ * be rounded before validation and storage, but we need to know how precisely 
this must happen.
+ *
  *
  * @author Michiel Meeuwissen
- * @version $Id: DecimalDataType.java,v 1.1 2008/12/01 17:24:14 michiel Exp $
+ * @version $Id: DecimalDataType.java,v 1.2 2008/12/01 17:50:51 michiel Exp $
  * @since MMBase-1.9.1
  */
 public class DecimalDataType extends NumberDataType<BigDecimal> implements 
LengthDataType<BigDecimal> {
_______________________________________________
Cvs mailing list
Cvs@lists.mmbase.org
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to