Package Framework

Examples of Framework.NumericData


            return format(new Double(doubleValue), (NumberFormat) getFormat());
        }
        // TF:12/03/2009:DET-83: We need to be able to handle strings and other data values as well,
        // just in case the model and the mapped type don't match
        else if (value instanceof NumericData) {
          NumericData numericValue = (NumericData) value;
          if (numericValue.isNullable() && numericValue.isNull()) {
              return "N/A";
          }
          return format(numericValue, (NumberFormat) getFormat());
        }
        else if (value instanceof DataValue) {
View Full Code Here


  public Object stringToValue(String text) throws ParseException
    {
      // TF:9/3/08:This class is only used to format numeric data objects, so we know from it's
      // construction that the value class must be a subclass of data value
      Class<? extends DataValue> formatClass = (Class<? extends DataValue>)getValueClass();
        NumericData numericData = (NumericData) FormatterUtils.createDataValueInstance(formatClass);
        if (!FormatterUtils.isNullable(numericData, text))
        {
            // Check if the value is null, then map to 0.  This is what Forte did.  CraigM: 19/02/2008.
            if (text == null || text.length() == 0) {
                setNumericData(numericData, 0);
            }
            else {
                Number number = (Number) getFormat().parseObject(text);
                setNumericData(numericData, number);
            }
        }
        else
        {
            numericData.setIsNull(true);
        }
        return numericData;
    }
View Full Code Here

            return format(new Double(doubleValue), (NumberFormat) getFormat());
        }
        // TF:12/03/2009:DET-83: We need to be able to handle strings and other data values as well,
        // just in case the model and the mapped type don't match
        else if (value instanceof NumericData) {
          NumericData numericValue = (NumericData) value;
          if (numericValue.isNullable() && numericValue.isNull()) {
              return "N/A";
          }
          return format(numericValue, (NumberFormat) getFormat());
        }
        else if (value instanceof DataValue) {
View Full Code Here

  public Object stringToValue(String text) throws ParseException
    {
      // TF:9/3/08:This class is only used to format numeric data objects, so we know from it's
      // construction that the value class must be a subclass of data value
      Class<? extends DataValue> formatClass = (Class<? extends DataValue>)getValueClass();
        NumericData numericData = (NumericData) FormatterUtils.createDataValueInstance(formatClass);
        if (!FormatterUtils.isNullable(numericData, text))
        {
            // Check if the value is null, then map to 0.  This is what Forte did.  CraigM: 19/02/2008.
            if (text == null || text.length() == 0) {
                setNumericData(numericData, 0);
            }
            else {
                Number number = (Number) getFormat().parseObject(text);
                setNumericData(numericData, number);
            }
        }
        else
        {
            numericData.setIsNull(true);
        }
        return numericData;
    }
View Full Code Here

TOP

Related Classes of Framework.NumericData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.