Examples of DecimalValue


Examples of net.sf.saxon.value.DecimalValue

    } else if(source instanceof Double) {
      result = new DoubleValue((Double)source);
    } else if(source instanceof Float) {
      result = new FloatValue((Float)source);
    } else if(source instanceof BigDecimal) {
      result = new DecimalValue((BigDecimal)source);
    } else if(source instanceof String) {
      result = new StringValue(((String)source));
    } else {
      result = new ObjectValue(source);
    }
View Full Code Here

Examples of net.sf.saxon.value.DecimalValue

        } else if (source instanceof Double) {
            result = new DoubleValue((Double)source);
        } else if (source instanceof Float) {
            result = new FloatValue((Float)source);
        } else if (source instanceof BigDecimal) {
            result = new DecimalValue((BigDecimal)source);
        } else if (source instanceof String) {
            result = new StringValue(((String)source));
        } else {
            result = new ObjectValue(source);
        }
View Full Code Here

Examples of net.sf.saxon.value.DecimalValue

        } else if (source instanceof Double) {
            result = new DoubleValue((Double)source);
        } else if (source instanceof Float) {
            result = new FloatValue((Float)source);
        } else if (source instanceof BigDecimal) {
            result = new DecimalValue((BigDecimal)source);
        } else if (source instanceof String) {
            result = new StringValue(((String)source));
        } else {
            result = new ObjectValue(source);
        }
View Full Code Here

Examples of net.sf.saxon.value.DecimalValue

        } else if (source instanceof Double) {
            result = new DoubleValue((Double)source);
        } else if (source instanceof Float) {
            result = new FloatValue((Float)source);
        } else if (source instanceof BigDecimal) {
            result = new DecimalValue((BigDecimal)source);
        } else if (source instanceof String) {
            result = new StringValue(((String)source));
        } else {
            result = new ObjectValue(source);
        }
View Full Code Here

Examples of net.sf.saxon.value.DecimalValue

        } else if (source instanceof Double) {
            result = new DoubleValue((Double)source);
        } else if (source instanceof Float) {
            result = new FloatValue((Float)source);
        } else if (source instanceof BigDecimal) {
            result = new DecimalValue((BigDecimal)source);
        } else if (source instanceof String) {
            result = new StringValue(((String)source));
        } else {
            result = new ObjectValue(source);
        }
View Full Code Here

Examples of org.exist.xquery.value.DecimalValue

            result = new IntegerValue(duration.getPart(DurationValue.HOUR));
      } else if (isCalledAs("minutes-from-duration")) {
            result = new IntegerValue(duration.getPart(DurationValue.MINUTE));
      } else if (isCalledAs("seconds-from-duration")) {
        if (duration.getCanonicalDuration().getField(DatatypeConstants.SECONDS) == null)
          {result = new DecimalValue(0);}
        else
          {result = new DecimalValue((BigDecimal)duration.getCanonicalDuration().getField(DatatypeConstants.SECONDS));}
        if (duration.getCanonicalDuration().getSign() < 0)
          {result = ((DecimalValue)result).negate();}
      } else if (isCalledAs("months-from-duration")) {
            result = new IntegerValue(duration.getPart(DurationValue.MONTH));
      } else if (isCalledAs("years-from-duration")) {
View Full Code Here

Examples of org.exist.xquery.value.DecimalValue

    @Test
    public void roundTripDecimal() throws EXistException {
        BigDecimal dec = new BigDecimal("123456789123456789123456789123456789.123456789123456789123456789");

        byte data[] = ValueIndexFactory.serialize(new DecimalValue(dec), 0);

        Indexable value = ValueIndexFactory.deserialize(data, 0, data.length);
        assertTrue(value instanceof DecimalValue);

        assertEquals(dec, ((DecimalValue)value).getValue());
View Full Code Here

Examples of org.exist.xquery.value.DecimalValue

        result = new IntegerValue(date.getPart(DateValue.MINUTE),
            Type.INTEGER);
      } else if (isCalledAs("seconds-from-dateTime") || isCalledAs("seconds-from-time")) {
        result = new IntegerValue(date.calendar.getSecond()).convertTo(Type.DECIMAL);
        if (date.calendar.getFractionalSecond() != null)           
          {result = ((DecimalValue)result).plus(new DecimalValue(date.calendar.getFractionalSecond()));}     
      } else if (isCalledAs("timezone-from-dateTime") || isCalledAs("timezone-from-date") || isCalledAs("timezone-from-time")) {
        result = date.getTimezone();
      } else {
                logger.error("can't handle function " + mySignature.getName().getLocalName());
        throw new Error("can't handle function " + mySignature.getName().getLocalName());
View Full Code Here

Examples of org.openhab.binding.tinkerforge.internal.types.DecimalValue

   * <!-- end-user-doc -->
   * @generated
   */
  public void setSensorValue(DecimalValue newSensorValue)
  {
    DecimalValue oldSensorValue = sensorValue;
    sensorValue = newSensorValue;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.AMBIENT_TEMPERATURE__SENSOR_VALUE, oldSensorValue, sensorValue));
  }
View Full Code Here

Examples of org.openhab.binding.tinkerforge.internal.types.DecimalValue

   * @generated NOT
   */
  private DecimalValue calculateTemperature(short temperature) {
    BigDecimal bigdecimal_temperature =
        new BigDecimal(String.valueOf(temperature)).divide(BigDecimal.TEN);
    DecimalValue value = new DecimalValue(bigdecimal_temperature);
    return value;
  }
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.