本文整理汇总了Java中org.openhab.core.library.types.DecimalType.toBigDecimal方法的典型用法代码示例。如果您正苦于以下问题:Java DecimalType.toBigDecimal方法的具体用法?Java DecimalType.toBigDecimal怎么用?Java DecimalType.toBigDecimal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openhab.core.library.types.DecimalType
的用法示例。
在下文中一共展示了DecimalType.toBigDecimal方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: modifyDecimalType4Read
import org.openhab.core.library.types.DecimalType; //导入方法依赖的package包/类
@Override
public DecimalType modifyDecimalType4Read(DecimalType pvModifyValue) {
if (pvModifyValue == null) {
return null;
}
BigDecimal lvResult = pvModifyValue.toBigDecimal();
if (pvModifyValue.equals(BigDecimal.ZERO)) {
return DecimalType.ZERO;
} else if (lvResult.equals(BigDecimal.ZERO)) {
return DecimalType.ZERO;
} else {
lvResult = lvResult.multiply(ivAdjustValue);
}
return new DecimalType(lvResult);
}
示例2: modifyDecimalType4Write
import org.openhab.core.library.types.DecimalType; //导入方法依赖的package包/类
@Override
public DecimalType modifyDecimalType4Write(DecimalType pvModifyValue) {
if (pvModifyValue == null) {
return null;
}
BigDecimal lvResult = pvModifyValue.toBigDecimal();
if (pvModifyValue.equals(BigDecimal.ZERO)) {
return DecimalType.ZERO;
} else if (lvResult.equals(BigDecimal.ZERO)) {
return DecimalType.ZERO;
} else {
lvResult = lvResult.divide(ivAdjustValue);
}
return new DecimalType(lvResult);
}
示例3: convertFromImpl
import org.openhab.core.library.types.DecimalType; //导入方法依赖的package包/类
@Override
protected NumberWithUnit convertFromImpl(DecimalType source) {
return new NumberWithUnit(Unit.WATT, source.toBigDecimal());
}
示例4: convertFromImpl
import org.openhab.core.library.types.DecimalType; //导入方法依赖的package包/类
@Override
protected NumberWithUnit convertFromImpl(DecimalType source) {
return new NumberWithUnit(Unit.VOLTAGE, source.toBigDecimal());
}
示例5: convertFromImpl
import org.openhab.core.library.types.DecimalType; //导入方法依赖的package包/类
@Override
protected NumberWithUnit convertFromImpl(DecimalType source) {
return new NumberWithUnit(Unit.PPM, source.toBigDecimal());
}
示例6: convertFromImpl
import org.openhab.core.library.types.DecimalType; //导入方法依赖的package包/类
@Override
protected NumberWithUnit convertFromImpl(DecimalType source) {
return new NumberWithUnit(Unit.PPB, source.toBigDecimal());
}
示例7: convertFromImpl
import org.openhab.core.library.types.DecimalType; //导入方法依赖的package包/类
@Override
protected NumberWithUnit convertFromImpl(DecimalType source) {
return new NumberWithUnit(Unit.LUX, source.toBigDecimal());
}
示例8: convertFromImpl
import org.openhab.core.library.types.DecimalType; //导入方法依赖的package包/类
@Override
protected NumberWithUnit convertFromImpl(DecimalType source) {
return new NumberWithUnit(Unit.DEGREE_CELSIUS, source.toBigDecimal());
}
示例9: convert
import org.openhab.core.library.types.DecimalType; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected BigDecimal convert(Item item, DecimalType command) {
return command.toBigDecimal();
}