本文整理汇总了Java中javax.measure.Unit.divide方法的典型用法代码示例。如果您正苦于以下问题:Java Unit.divide方法的具体用法?Java Unit.divide怎么用?Java Unit.divide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.measure.Unit
的用法示例。
在下文中一共展示了Unit.divide方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: areFunctionallyIdenticalUnits
import javax.measure.Unit; //导入方法依赖的package包/类
private static boolean areFunctionallyIdenticalUnits(Unit<?> left, Unit<?> right) {
if (!left.isCompatible(right)) {
return false;
}
Unit<?> divided = left.divide(right);
if (!divided.getDimension().equals(Dimension.NONE)) {
return false;
}
return divided.asType(Dimensionless.class).getConverterTo(ONE).equals(IDENTITY);
}
示例2: Term
import javax.measure.Unit; //导入方法依赖的package包/类
final public Unit Term() throws TokenException {
Unit result = ONE;
Unit temp = ONE;
result = Component();
label_1:
while (true) {
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case DOT:
case SOLIDUS:
break;
default:
jj_la1[0] = jj_gen;
break label_1;
}
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case DOT:
jj_consume_token(DOT);
temp = Component();
result = result.multiply(temp);
break;
case SOLIDUS:
jj_consume_token(SOLIDUS);
temp = Component();
result = result.divide(temp);
break;
default:
jj_la1[1] = jj_gen;
jj_consume_token(-1);
throw new TokenException();
}
}
{
return result;
}
}
示例3: MulExpr
import javax.measure.Unit; //导入方法依赖的package包/类
final public Unit MulExpr() throws TokenException {
Unit result = ONE;
Unit temp = ONE;
result = ExponentExpr();
label_2:
while (true) {
switch ((nextTokenIndex == -1) ? jj_ntk() : nextTokenIndex) {
case ASTERISK:
case MIDDLE_DOT:
case SOLIDUS:
break;
default:
laA[2] = genInt;
break label_2;
}
switch ((nextTokenIndex == -1) ? jj_ntk() : nextTokenIndex) {
case ASTERISK:
case MIDDLE_DOT:
switch ((nextTokenIndex == -1) ? jj_ntk() : nextTokenIndex) {
case ASTERISK:
consumeToken(ASTERISK);
break;
case MIDDLE_DOT:
consumeToken(MIDDLE_DOT);
break;
default:
laA[3] = genInt;
consumeToken(-1);
throw new TokenException();
}
temp = ExponentExpr();
result = result.multiply(temp);
break;
case SOLIDUS:
consumeToken(SOLIDUS);
temp = ExponentExpr();
result = result.divide(temp);
break;
default:
laA[4] = genInt;
consumeToken(-1);
throw new TokenException();
}
}
{
return result;
}
}