本文整理汇总了Java中org.jscience.physics.amount.Amount.times方法的典型用法代码示例。如果您正苦于以下问题:Java Amount.times方法的具体用法?Java Amount.times怎么用?Java Amount.times使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jscience.physics.amount.Amount
的用法示例。
在下文中一共展示了Amount.times方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testMisc
import org.jscience.physics.amount.Amount; //导入方法依赖的package包/类
@Test(expected = ConversionException.class)
public void testMisc() {
Amount<Length> position = Amount.valueOf(1, 0.02, SI.METER);
Amount<Length> position2 = Amount.valueOf(1, 0.02, SI.METER);
Amount<?> positionResult = position.times(position2);
System.out.println(positionResult);
System.out.println(positionResult.getAbsoluteError());
System.out.println(positionResult.getRelativeError());
position.divide(position2).to(SI.METER);
}
示例2: getStandardSeconds
import org.jscience.physics.amount.Amount; //导入方法依赖的package包/类
/** Parses a time string in hours, minutes, and seconds.
* Returns a duration (converted to standard SI seconds,
* if using Mars time-of-sol).
*/
public Amount<Duration> getStandardSeconds(String string) throws ParseException {
Amount<Duration> standardSeconds = getJavaObjectFromTrimmed(string, null);
if (standardSeconds==null) return null;
return standardSeconds.times(standardSecondsPerLocalSecond);
}