com.thaiopensource.datatype.xsd
Class DecimalDatatype

java.lang.Object
  extended by com.thaiopensource.datatype.xsd.DatatypeBase
      extended by com.thaiopensource.datatype.xsd.DecimalDatatype
All Implemented Interfaces:
Datatype2, OrderRelation, Datatype

 class DecimalDatatype
extends DatatypeBase
implements OrderRelation


Field Summary
 
Fields inherited from class com.thaiopensource.datatype.xsd.DatatypeBase
WHITE_SPACE_COLLAPSE, WHITE_SPACE_PRESERVE, WHITE_SPACE_REPLACE
 
Fields inherited from interface org.relaxng.datatype.Datatype
ID_TYPE_ID, ID_TYPE_IDREF, ID_TYPE_IDREFS, ID_TYPE_NULL
 
Constructor Summary
DecimalDatatype()
           
 
Method Summary
(package private)  OrderRelation getOrderRelation()
           
(package private)  Object getValue(String str, ValidationContext vc)
           
 boolean isLessThan(Object obj1, Object obj2)
           
(package private)  boolean lexicallyAllows(String str)
           
 boolean sameValue(Object value1, Object value2)
          BigDecimal.equals considers objects distinct if they have the different scales but the same mathematical value.
 int valueHashCode(Object value)
          Computes the hash code for a value object, which is consistent with the sameValue method.
 
Methods inherited from class com.thaiopensource.datatype.xsd.DatatypeBase
allowsValue, alwaysValid, checkValid, createStreamingValidator, createValue, getIdType, getMeasure, getPrimitive, getWhiteSpace, isContextDependent, isValid, normalizeWhiteSpace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DecimalDatatype

DecimalDatatype()
Method Detail

lexicallyAllows

boolean lexicallyAllows(String str)
Specified by:
lexicallyAllows in class DatatypeBase

getValue

Object getValue(String str,
                ValidationContext vc)
Specified by:
getValue in class DatatypeBase

getOrderRelation

OrderRelation getOrderRelation()
Overrides:
getOrderRelation in class DatatypeBase

isLessThan

public boolean isLessThan(Object obj1,
                          Object obj2)
Specified by:
isLessThan in interface OrderRelation

sameValue

public boolean sameValue(Object value1,
                         Object value2)
BigDecimal.equals considers objects distinct if they have the different scales but the same mathematical value. Similarly for hashCode.

Specified by:
sameValue in interface Datatype
Overrides:
sameValue in class DatatypeBase
Returns:
true if two value objects are considered equal according to the definition of this datatype; false if otherwise.

valueHashCode

public int valueHashCode(Object value)
Description copied from interface: Datatype
Computes the hash code for a value object, which is consistent with the sameValue method.

Specified by:
valueHashCode in interface Datatype
Overrides:
valueHashCode in class DatatypeBase
Returns:
hash code for the specified value object.