Examples of NumericData


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

Examples of Framework.NumericData

  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

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

Examples of Framework.NumericData

  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

Examples of mil.nga.giat.geowave.index.sfc.data.NumericData

   */
  public static Constraints basicConstraintsFromPoint(
      final double latitudeDegrees,
      final double longitudeDegrees ) {
    // Create a NumericData object using the x axis
    final NumericData latitude = new NumericValue(
        latitudeDegrees);

    // Create a NumericData object using the y axis
    final NumericData longitude = new NumericValue(
        longitudeDegrees);

    final Map<Class<? extends NumericDimensionDefinition>, NumericData> constraintsPerDimension = new HashMap<Class<? extends NumericDimensionDefinition>, NumericData>();
    // Create and return a new IndexRange array with an x and y axis
    // range
View Full Code Here

Examples of mil.nga.giat.geowave.index.sfc.data.NumericData

      final CommonIndexModel indexModel ) {
    final DimensionField<?>[] dimensionFields = indexModel.getDimensions();
    final List<QueryFilter> filters = new ArrayList<QueryFilter>();
    final NumericData[] orderedConstraintsPerDimension = new NumericData[dimensionFields.length];
    for (int d = 0; d < dimensionFields.length; d++) {
      final NumericData nd = constraints.constraintsPerTypeOfDimensionDefinition.get(dimensionFields[d].getBaseDefinition().getClass());
      if (nd == null) {
        orderedConstraintsPerDimension[d] = dimensionFields[d].getBaseDefinition().getFullRange();
      }
      else {
        orderedConstraintsPerDimension[d] = constraints.constraintsPerTypeOfDimensionDefinition.get(dimensionFields[d].getBaseDefinition().getClass());
View Full Code Here

Examples of mil.nga.giat.geowave.index.sfc.data.NumericData

      }
      final NumericDimensionDefinition[] dimensionDefinitions = indexStrategy.getOrderedDimensionDefinitions();
      final NumericData[] dataPerDimension = new NumericData[dimensionDefinitions.length];
      // all or nothing...for now
      for (int d = 0; d < dimensionDefinitions.length; d++) {
        final NumericData dimConstraint = constraintsPerTypeOfDimensionDefinition.get(dimensionDefinitions[d].getClass());
        dataPerDimension[d] = (dimConstraint == null ? dimensionDefinitions[d].getFullRange() : dimConstraint);
      }
      return new BasicNumericDataset(
          dataPerDimension);
    }
View Full Code Here

Examples of mil.nga.giat.geowave.index.sfc.data.NumericData

    final List<byte[]> lengthDimensionAndQueryBinaries = new ArrayList<byte[]>(
        dimensions);
    final NumericData[] dataPerDimension = constraints.getDataPerDimension();
    for (int d = 0; d < dimensions; d++) {
      final DimensionField<?> dimension = dimensionFields[d];
      final NumericData data = dataPerDimension[d];
      final byte[] dimensionBinary = PersistenceUtils.toBinary(dimension);
      final int currentDimensionByteBufferLength = (20 + dimensionBinary.length);

      final ByteBuffer buf = ByteBuffer.allocate(currentDimensionByteBufferLength);
      buf.putInt(dimensionBinary.length);
      buf.putDouble(data.getMin());
      buf.putDouble(data.getMax());
      buf.put(dimensionBinary);
      byteBufferLength += currentDimensionByteBufferLength;
      lengthDimensionAndQueryBinaries.add(buf.array());
    }
    final ByteBuffer buf = ByteBuffer.allocate(byteBufferLength);
View Full Code Here

Examples of mil.nga.giat.geowave.index.sfc.data.NumericData

  @SuppressWarnings("unchecked")
  @Override
  public PersistentValue<Object>[] toNativeValues(
      final Time indexValue ) {
    final NumericData value = indexValue.toNumericData();
    final Class<?> startBindingClass = nativeStartTimeHandler.attrDesc.getType().getBinding();
    final Object startObj = TimeUtils.getTimeValue(
        startBindingClass,
        (long) value.getMin());
    final Class<?> endBindingClass = nativeEndTimeHandler.attrDesc.getType().getBinding();
    final Object endObj = TimeUtils.getTimeValue(
        endBindingClass,
        (long) value.getMax());
    return new PersistentValue[] {
      new PersistentValue<Object>(
          nativeStartTimeHandler.getFieldId(),
          startObj),
      new PersistentValue<Object>(
View Full Code Here

Examples of net.helipilot50.stocktrade.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
TOP
Copyright © 2018 www.massapi.com. 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.