KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > thaiopensource > datatype > xsd > ScaleRestrictDatatype


1 package com.thaiopensource.datatype.xsd;
2
3 import java.math.BigDecimal JavaDoc;
4
5 class ScaleRestrictDatatype extends ValueRestrictDatatype {
6   private final int scale;
7
8   ScaleRestrictDatatype(DatatypeBase base, int scale) {
9     super(base);
10     this.scale = scale;
11   }
12
13   boolean satisfiesRestriction(Object JavaDoc obj) {
14     return ((BigDecimal JavaDoc)obj).scale() <= scale;
15   }
16 }
17
Popular Tags