public Object _createValue( String lexicalValue, ValidationContext context ) { return load(lexicalValue); }
public String convertToLexicalValue( Object value, SerializationContext context ) { if(!(value instanceof Double )) throw new IllegalArgumentException(); return save((Double)value); }
public static Double load( String lexicalValue ) { // TODO : probably the same problems exist as in the case of float try { if(lexicalValue.equals("NaN")) return new Double(Double.NaN); if(lexicalValue.equals("INF")) return new Double(Double.POSITIVE_INFINITY); if(lexicalValue.equals("-INF")) return new Double(Double.NEGATIVE_INFINITY); if(lexicalValue.length()==0 || !isDigitOrPeriodOrSign(lexicalValue.charAt(0)) || !isDigitOrPeriodOrSign(lexicalValue.charAt(lexicalValue.length()-1)) ) return null; // these screening process is necessary due to the wobble of Float.valueOf method return Double.valueOf(lexicalValue); } catch( NumberFormatException e ) { return null; } }
assertTrue( SimpleURType.theInstance==HexBinaryType.theInstance.getBaseType() ); assertTrue( SimpleURType.theInstance==FloatType.theInstance.getBaseType() ); assertTrue( SimpleURType.theInstance==DoubleType.theInstance.getBaseType() ); assertTrue( SimpleURType.theInstance==AnyURIType.theInstance.getBaseType() ); assertTrue( SimpleURType.theInstance==QnameType.theInstance.getBaseType() );
public static Double load( String lexicalValue ) { // TODO : probably the same problems exist as in the case of float try { if(lexicalValue.equals("NaN")) return new Double(Double.NaN); if(lexicalValue.equals("INF")) return new Double(Double.POSITIVE_INFINITY); if(lexicalValue.equals("-INF")) return new Double(Double.NEGATIVE_INFINITY); if(lexicalValue.length()==0 || !isDigitOrPeriodOrSign(lexicalValue.charAt(0)) || !isDigitOrPeriodOrSign(lexicalValue.charAt(lexicalValue.length()-1)) ) return null; // these screening process is necessary due to the wobble of Float.valueOf method return Double.valueOf(lexicalValue); } catch( NumberFormatException e ) { return null; } }
public String convertToLexicalValue( Object value, SerializationContext context ) { if(!(value instanceof Double )) throw new IllegalArgumentException(); return save((Double)value); }
public Object _createValue( String lexicalValue, ValidationContext context ) { return load(lexicalValue); }
public static Double load( String lexicalValue ) { // TODO : probably the same problems exist as in the case of float try { if(lexicalValue.equals("NaN")) return new Double(Double.NaN); if(lexicalValue.equals("INF")) return new Double(Double.POSITIVE_INFINITY); if(lexicalValue.equals("-INF")) return new Double(Double.NEGATIVE_INFINITY); if(lexicalValue.length()==0 || !isDigitOrPeriodOrSign(lexicalValue.charAt(0)) || !isDigitOrPeriodOrSign(lexicalValue.charAt(lexicalValue.length()-1)) ) return null; // these screening process is necessary due to the wobble of Float.valueOf method return Double.valueOf(lexicalValue); } catch( NumberFormatException e ) { return null; } }
public String convertToLexicalValue( Object value, SerializationContext context ) { if(!(value instanceof Double )) throw new IllegalArgumentException(); return save((Double)value); }
public Object _createValue( String lexicalValue, ValidationContext context ) { return load(lexicalValue); }
public static Double load( String lexicalValue ) { // TODO : probably the same problems exist as in the case of float try { if(lexicalValue.equals("NaN")) return new Double(Double.NaN); if(lexicalValue.equals("INF")) return new Double(Double.POSITIVE_INFINITY); if(lexicalValue.equals("-INF")) return new Double(Double.NEGATIVE_INFINITY); if(lexicalValue.length()==0 || !isDigitOrPeriodOrSign(lexicalValue.charAt(0)) || !isDigitOrPeriodOrSign(lexicalValue.charAt(lexicalValue.length()-1)) ) return null; // these screening process is necessary due to the wobble of Float.valueOf method return Double.valueOf(lexicalValue); } catch( NumberFormatException e ) { return null; } }
public String convertToLexicalValue( Object value, SerializationContext context ) { if(!(value instanceof Double )) throw new IllegalArgumentException(); return save((Double)value); }
public Object _createValue( String lexicalValue, ValidationContext context ) { return load(lexicalValue); }
public static Double load( String lexicalValue ) { // TODO : probably the same problems exist as in the case of float try { if(lexicalValue.equals("NaN")) return new Double(Double.NaN); if(lexicalValue.equals("INF")) return new Double(Double.POSITIVE_INFINITY); if(lexicalValue.equals("-INF")) return new Double(Double.NEGATIVE_INFINITY); if(lexicalValue.length()==0 || !isDigitOrPeriodOrSign(lexicalValue.charAt(0)) || !isDigitOrPeriodOrSign(lexicalValue.charAt(lexicalValue.length()-1)) ) return null; // these screening process is necessary due to the wobble of Float.valueOf method return Double.valueOf(lexicalValue); } catch( NumberFormatException e ) { return null; } }
public String convertToLexicalValue( Object value, SerializationContext context ) { if(!(value instanceof Double )) throw new IllegalArgumentException(); return save((Double)value); }
public Object _createValue( String lexicalValue, ValidationContext context ) { return load(lexicalValue); }