Examples of toBigDecimal()


Examples of org.exolab.castor.xml.schema.Facet.toBigDecimal()

                continue; // do not check against self
            }
            final String otherName = other.getName();
            if (otherName.equals(Facet.MAX_EXCLUSIVE)
                    && getOwningType().isNumericType()
                    && this.toBigDecimal().compareTo(other.toBigDecimal()) >= 0) {
                // Schema Component Constraint: minInclusive < maxExclusive
                throw new SchemaException(
                        "It is an error for the value specified "
                        + "for minInclusive to be greater than "
                        + "or equal to the value specified for "
View Full Code Here

Examples of org.exolab.castor.xml.schema.Facet.toBigDecimal()

                // Schema Component Constraint: minInclusive valid restriction
                //   It is an error if any of the following conditions is true:
                if (otherName.equals(Facet.MIN_INCLUSIVE)
                        && getOwningType().isNumericType()
                        && this.toBigDecimal().compareTo(other.toBigDecimal()) < 0) {
                    // [1]
                    throw new SchemaException(
                            "It is an error if the following condition is true: "
                            + "minInclusive is among the members of {facets} of "
                            + "{base type definition} and {value} is less than "
View Full Code Here

Examples of org.exolab.castor.xml.schema.Facet.toBigDecimal()

                            + "minInclusive is among the members of {facets} of "
                            + "{base type definition} and {value} is less than "
                            + "the {value} of the parent minInclusive.");
                } else if (otherName.equals(Facet.MAX_INCLUSIVE)
                        && getOwningType().isNumericType()
                        && this.toBigDecimal().compareTo(other.toBigDecimal()) > 0) {
                    // [2]
                    throw new SchemaException(
                            "It is an error if the following condition is true: "
                            + "maxInclusive is among the members of {facets} of "
                            + "{base type definition} and {value} is greater than "
View Full Code Here

Examples of org.exolab.castor.xml.schema.Facet.toBigDecimal()

                            + "maxInclusive is among the members of {facets} of "
                            + "{base type definition} and {value} is greater than "
                            + "the {value} of the parent maxInclusive.");
                } else if (otherName.equals(Facet.MIN_EXCLUSIVE)
                        && getOwningType().isNumericType()
                        && this.toBigDecimal().compareTo(other.toBigDecimal()) <= 0) {
                    // [3]
                    throw new SchemaException(
                            "It is an error if the following condition is true: "
                            + "minExclusive is among the members of {facets} of "
                            + "{base type definition} and {value} is less than "
View Full Code Here

Examples of org.exolab.castor.xml.schema.Facet.toBigDecimal()

                            + "minExclusive is among the members of {facets} of "
                            + "{base type definition} and {value} is less than "
                            + "or equal to the {value} of the parent minExclusive.");
                } else if (otherName.equals(Facet.MAX_EXCLUSIVE)
                        && getOwningType().isNumericType()
                        && this.toBigDecimal().compareTo(other.toBigDecimal()) >= 0) {
                    // [4]
                    throw new SchemaException(
                            "It is an error if the following condition is true: "
                            + "maxExclusive is among the members of {facets} of "
                            + "{base type definition} and {value} is greater than "
View Full Code Here

Examples of org.openhab.core.library.types.DecimalType.toBigDecimal()

    }

    // if the current state is a valid value, we calculate the up and down step values
    if(state instanceof DecimalType) {
      DecimalType actState = (DecimalType) state;
      BigDecimal newLower = actState.toBigDecimal().subtract(step);
      BigDecimal newHigher = actState.toBigDecimal().add(step);
      if(newLower.compareTo(minValue) < 0) {
        newLower = minValue;
      }
      if(newHigher.compareTo(maxValue) > 0) {
View Full Code Here

Examples of org.openhab.core.library.types.DecimalType.toBigDecimal()

    // if the current state is a valid value, we calculate the up and down step values
    if(state instanceof DecimalType) {
      DecimalType actState = (DecimalType) state;
      BigDecimal newLower = actState.toBigDecimal().subtract(step);
      BigDecimal newHigher = actState.toBigDecimal().add(step);
      if(newLower.compareTo(minValue) < 0) {
        newLower = minValue;
      }
      if(newHigher.compareTo(maxValue) > 0) {
        newHigher = maxValue;
View Full Code Here

Examples of org.openhab.core.library.types.DecimalType.toBigDecimal()

        Sample sample = db.createSample();
              sample.setTime(now);
             
              DecimalType state = (DecimalType) item.getStateAs(DecimalType.class);
              if (state!=null) {
                    double value = state.toBigDecimal().doubleValue();
                    sample.setValue(DATASOURCE_STATE, value);
                    sample.update();
                    logger.debug("Stored '{}' with state '{}' in rrd4j database", name, item.getState());
              }
      } catch (IllegalArgumentException e) {
View Full Code Here

Examples of org.openhab.core.library.types.PercentType.toBigDecimal()

      } else if (channelState.equals(UpDownType.DOWN)) {
        command.append(DOWN_BYTE);
      } else if (channelState instanceof PercentType){
        // calculate dimmer value...
        PercentType currentState = (PercentType) channelState;
        int value = BigDecimal.valueOf(255).multiply(currentState.toBigDecimal()).divide(BigDecimal.valueOf(100), 0,
            BigDecimal.ROUND_UP).intValue();
        command.append(StringUtils.leftPad(Integer.toHexString(value), 2, "0").toUpperCase());
      } else {
        command.append(HIGH_BYTE);
      }
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.