本文整理汇总了Java中javax.measure.Quantity.divide方法的典型用法代码示例。如果您正苦于以下问题:Java Quantity.divide方法的具体用法?Java Quantity.divide怎么用?Java Quantity.divide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.measure.Quantity
的用法示例。
在下文中一共展示了Quantity.divide方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getConcentration
import javax.measure.Quantity; //导入方法依赖的package包/类
@Override
public Quantity<MolarConcentration> getConcentration(ChemicalEntity chemicalEntity) {
Quantity<MolarConcentration> concentrationSum = getAvailableConcentration(outerPhaseSection, chemicalEntity);
concentrationSum = concentrationSum.add(getAvailableConcentration(innerPhaseSection, chemicalEntity));
concentrationSum = concentrationSum.add(getAvailableConcentration(membrane.getInnerLayer(), chemicalEntity));
concentrationSum = concentrationSum.add(getAvailableConcentration(membrane.getOuterLayer(), chemicalEntity));
return concentrationSum.divide(4.0);
}
示例2: getAvailableConcentration
import javax.measure.Quantity; //导入方法依赖的package包/类
@Override
public Quantity<MolarConcentration> getAvailableConcentration(CellSection cellSection, ChemicalEntity chemicalEntity) {
if (cellSection.equals(outerPhaseSection)) {
if (outerPhase.containsKey(chemicalEntity)) {
return outerPhase.get(chemicalEntity);
}
} else if (cellSection.equals(innerPhaseSection)) {
if (innerPhase.containsKey(chemicalEntity)) {
return innerPhase.get(chemicalEntity);
}
} else if (cellSection.equals(membrane)) {
Quantity<MolarConcentration> concentrationSum;
if (innerLayer.containsKey(chemicalEntity)) {
concentrationSum = (innerLayer.get(chemicalEntity));
concentrationSum = concentrationSum.add(outerLayer.get(chemicalEntity));
return concentrationSum.divide(2.0);
}
} else if (cellSection.equals(membrane.getInnerLayer())) {
if (innerLayer.containsKey(chemicalEntity)) {
return innerLayer.get(chemicalEntity);
}
} else if (cellSection.equals(membrane.getOuterLayer())) {
if (outerLayer.containsKey(chemicalEntity)) {
return outerLayer.get(chemicalEntity);
}
}
return Quantities.getQuantity(0.0, UnitProvider.MOLE_PER_LITRE);
}