org.apache.xerces.validators.datatype
Class FloatDatatypeValidator

java.lang.Object
  |
  +--org.apache.xerces.validators.datatype.AbstractDatatypeValidator
        |
        +--org.apache.xerces.validators.datatype.FloatDatatypeValidator

public class FloatDatatypeValidator
extends AbstractDatatypeValidator

Version:
$Id: FloatDatatypeValidator.java,v 1.11 2000/10/17 00:52:39 jeffreyr Exp $
Author:
Ted Leung, Jeffrey Rodriguez, Mark Swinkles - List Validation refactoring

Constructor Summary
FloatDatatypeValidator()
           
FloatDatatypeValidator(DatatypeValidator base, java.util.Hashtable facets, boolean derivedByList)
           
 
Method Summary
 java.lang.Object clone()
          Returns a copy of this object.
 int compare(java.lang.String content1, java.lang.String content2)
          Compares content in the Domain value vs.
 java.util.Hashtable getFacets()
          returns the datatype facet if any is set as a Hashtable
 void setLocale(java.util.Locale locale)
          set the locate to be used for error messages
 java.lang.Object validate(java.lang.String content, java.lang.Object state)
          Validate string content to be a valid float as defined 3.2.3.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FloatDatatypeValidator

public FloatDatatypeValidator()
                       throws InvalidDatatypeFacetException

FloatDatatypeValidator

public FloatDatatypeValidator(DatatypeValidator base,
                              java.util.Hashtable facets,
                              boolean derivedByList)
                       throws InvalidDatatypeFacetException
Method Detail

validate

public java.lang.Object validate(java.lang.String content,
                                 java.lang.Object state)
                          throws InvalidDatatypeValueException
Validate string content to be a valid float as defined 3.2.3. Datatype. IEEE single-precision 32-bit floatin point type [IEEE] 754-1985]. The basic value space of float consists of the values mx2^e, where m is an integer whose absolute value is less than 2^24, and e is an integer between -149 and 104 inclusive.
Overrides:
validate in class AbstractDatatypeValidator
Parameters:
content - A string containing the content to be validated
state -  
Returns:
 
Throws:
throws - InvalidDatatypeException if the content is is not a W3C real type
InvalidDatatypeValueException -  

setLocale

public void setLocale(java.util.Locale locale)
set the locate to be used for error messages

compare

public int compare(java.lang.String content1,
                   java.lang.String content2)
Description copied from class: AbstractDatatypeValidator
Compares content in the Domain value vs. lexical value. e.g. If type is a float then 1.0 may be equivalent to 1 even tough both are lexically different.
Overrides:
compare in class AbstractDatatypeValidator
Tags copied from class: AbstractDatatypeValidator
Parameters:
value1 -  
valu2 -  
Returns:
 

getFacets

public java.util.Hashtable getFacets()
Description copied from class: AbstractDatatypeValidator
returns the datatype facet if any is set as a Hashtable
Overrides:
getFacets in class AbstractDatatypeValidator
Tags copied from class: AbstractDatatypeValidator
Returns:
 

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a copy of this object.
Overrides:
clone in class AbstractDatatypeValidator


Copyright © 1999-2000 Apache XML Project. All Rights Reserved.