当前位置: 首页>>代码示例>>Java>>正文


Java SI.MILLI属性代码示例

本文整理汇总了Java中javax.measure.unit.SI.MILLI属性的典型用法代码示例。如果您正苦于以下问题:Java SI.MILLI属性的具体用法?Java SI.MILLI怎么用?Java SI.MILLI使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.measure.unit.SI的用法示例。


在下文中一共展示了SI.MILLI属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testLocationInterp2D

public void testLocationInterp2D()
{
  final LocationDocumentBuilder loc1b =
      new LocationDocumentBuilder("loc1", null, SI.MILLI(SI.SECOND), SI.METER);
  final IGeoCalculator builder = loc1b.getCalculator();
  loc1b.add(1000, builder.createPoint(2, 3));
  loc1b.add(2000, builder.createPoint(3, 4));

  final LocationDocument loc1 = loc1b.toDocument();

  Point2D geo1 = loc1.locationAt(1500);
  assertEquals("correct value", 2.5, geo1.getX());
  assertEquals("correct value", 3.5, geo1.getY());

  geo1 = loc1.locationAt(1700);
  assertEquals("correct value", 2.7, geo1.getX());
  assertEquals("correct value", 3.7, geo1.getY());
}
 
开发者ID:debrief,项目名称:limpet,代码行数:18,代码来源:TestGeotoolsGeometry.java

示例2: testLocationInterp

public void testLocationInterp()
{
  final LocationDocumentBuilder loc1b =
      new LocationDocumentBuilder("loc1", null, SI.MILLI(SI.SECOND));
  final IGeoCalculator builder = loc1b.getCalculator();
  loc1b.add(1000, builder.createPoint(2, 3));
  loc1b.add(2000, builder.createPoint(3, 4));

  final LocationDocument loc1 = loc1b.toDocument();

  Point2D geo1 = loc1.locationAt(1500);
  assertEquals("correct value", 2.5, geo1.getX());
  assertEquals("correct value", 3.5, geo1.getY());

  geo1 = loc1.locationAt(1700);
  assertEquals("correct value", 2.7, geo1.getX());
  assertEquals("correct value", 3.7, geo1.getY());
}
 
开发者ID:debrief,项目名称:limpet,代码行数:18,代码来源:TestGeotoolsGeometry.java

示例3: testLocationCalc2D

public void testLocationCalc2D()
{
  final LocationDocumentBuilder loc1 =
      new LocationDocumentBuilder("loc1", null, SI.MILLI(SI.SECOND), SI.METER);
  final LocationDocumentBuilder loc2 =
      new LocationDocumentBuilder("loc2", null, SI.MILLI(SI.SECOND), SI.METER);

  final List<IStoreItem> selection = new ArrayList<IStoreItem>();
  selection.add(loc1.toDocument());

  final StoreGroup store = new StoreGroup("Results");

  // ok, try adding some data
  final IGeoCalculator builder = loc1.getCalculator();

  loc1.add(1000, builder.createPoint(4, 3));
  loc1.add(2000, builder.createPoint(3, 4));

  loc2.add(1000, builder.createPoint(5, 3));
  loc2.add(2000, builder.createPoint(3, 6));

  // put in the new documents
  selection.clear();
  selection.add(loc1.toDocument());
  selection.add(loc2.toDocument());

  List<ICommand> ops =
      new DistanceBetweenTracksOperation().actionsFor(selection, store,
          context);
  assertEquals("not empty collection", 1, ops.size());
  ICommand firstC = ops.get(0);
  // ok, execute it
  firstC.execute();

  NumberDocument output = (NumberDocument) firstC.getOutputs().get(0);
  DoubleDataset data = (DoubleDataset) output.getDataset();
  assertEquals(1d, data.get(0), 0.0001);
  assertEquals(2d, data.get(1), 0.0001);
}
 
开发者ID:debrief,项目名称:limpet,代码行数:39,代码来源:TestGeotoolsGeometry.java

示例4: testLocationCalc

public void testLocationCalc()
{
  final LocationDocumentBuilder loc1 =
      new LocationDocumentBuilder("loc1", null, SI.MILLI(SI.SECOND));
  final LocationDocumentBuilder loc2 =
      new LocationDocumentBuilder("loc2", null, SI.MILLI(SI.SECOND));
  final NumberDocumentBuilder len1b =
      new NumberDocumentBuilder("dummy", METRE.asType(Length.class), null,
          null);

  final List<IStoreItem> selection = new ArrayList<IStoreItem>();
  selection.add(loc1.toDocument());

  final StoreGroup store = new StoreGroup("Results");

  Collection<ICommand> ops =
      new DistanceBetweenTracksOperation().actionsFor(selection, store,
          context);
  assertEquals("empty collection", 0, ops.size());

  final NumberDocument len1 = len1b.toDocument();

  selection.add(len1);
  ops =
      new DistanceBetweenTracksOperation().actionsFor(selection, store,
          context);
  assertEquals("empty collection", 0, ops.size());

  selection.remove(len1);
  selection.add(loc2.toDocument());
  ops =
      new DistanceBetweenTracksOperation().actionsFor(selection, store,
          context);
  assertEquals("empty collection", 0, ops.size());

  // ok, try adding some data
  final IGeoCalculator builder = loc1.getCalculator();

  loc1.add(1000, builder.createPoint(4, 3));
  loc2.add(2000, builder.createPoint(3, 4));

  // put in the new documents
  selection.clear();
  selection.add(loc1.toDocument());
  selection.add(loc2.toDocument());

  ops =
      new DistanceBetweenTracksOperation().actionsFor(selection, store,
          context);
  assertEquals("not empty collection", 1, ops.size());
}
 
开发者ID:debrief,项目名称:limpet,代码行数:51,代码来源:TestGeotoolsGeometry.java

示例5: testLocationSingletonCalcDistance

public void testLocationSingletonCalcDistance()
{
  final LocationDocumentBuilder loc1 =
      new LocationDocumentBuilder("loc1", null, SI.MILLI(SI.SECOND));
  final LocationDocumentBuilder singletonLoc =
      new LocationDocumentBuilder("loc2", null, SI.MILLI(SI.SECOND));
  final NumberDocumentBuilder len1b =
      new NumberDocumentBuilder("dummy", METRE.asType(Length.class), null,
          null);

  final IOperation distanceOp = new DistanceBetweenTracksOperation();
  final IGeoCalculator builder = loc1.getCalculator();

  final List<IStoreItem> selection = new ArrayList<IStoreItem>();
  selection.add(loc1.toDocument());

  final StoreGroup store = new StoreGroup("Results");

  List<ICommand> ops = distanceOp.actionsFor(selection, store, context);
  assertEquals("empty collection", 0, ops.size());

  final NumberDocument len1 = len1b.toDocument();

  selection.add(len1);
  ops = distanceOp.actionsFor(selection, store, context);
  assertEquals("empty collection", 0, ops.size());

  selection.remove(len1);
  selection.add(singletonLoc.toDocument());
  ops = distanceOp.actionsFor(selection, store, context);
  assertEquals("empty collection", 0, ops.size());

  // ok, try adding some data
  loc1.add(1000, builder.createPoint(4, 3));
  singletonLoc.add(2000, builder.createPoint(3, 4));

  // put in the new documents
  selection.clear();
  selection.add(loc1.toDocument());
  selection.add(singletonLoc.toDocument());

  ops = distanceOp.actionsFor(selection, store, context);
  assertEquals("not empty collection", 1, ops.size());

  assertEquals("store empty", 0, store.size());

  ops.get(0).execute();

  assertEquals("store no longer empty", 1, store.size());
  // add some more entries to loc1
  loc1.add(2000, builder.createPoint(4, 3));
  loc1.add(3000, builder.createPoint(4, 3));
  loc1.add(4000, builder.createPoint(4, 3));

  // put in the new documents
  selection.clear();
  selection.add(loc1.toDocument());
  selection.add(singletonLoc.toDocument());

  ops = distanceOp.actionsFor(selection, store, context);
  assertEquals("not empty collection", 1, ops.size());

  // run the interpolation command
  store.clear();
  ops.get(0).execute();
  assertEquals("store has other collection", 1, store.size());
}
 
开发者ID:debrief,项目名称:limpet,代码行数:67,代码来源:TestGeotoolsGeometry.java

示例6: testLocationSingletonCalcDistanceMixedIndex

public void testLocationSingletonCalcDistanceMixedIndex()
{
  final LocationDocumentBuilder loc1 =
      new LocationDocumentBuilder("loc1", null, SI.MILLI(SI.SECOND));
  final LocationDocumentBuilder singletonLoc =
      new LocationDocumentBuilder("loc2", null, null);
  final NumberDocumentBuilder len1b =
      new NumberDocumentBuilder("dummy", METRE.asType(Length.class), null,
          null);

  final IOperation distanceOp = new DistanceBetweenTracksOperation();
  final IGeoCalculator builder = loc1.getCalculator();

  final List<IStoreItem> selection = new ArrayList<IStoreItem>();
  selection.add(loc1.toDocument());

  final StoreGroup store = new StoreGroup("Results");

  List<ICommand> ops = distanceOp.actionsFor(selection, store, context);
  assertEquals("empty collection", 0, ops.size());

  final NumberDocument len1 = len1b.toDocument();

  selection.add(len1);
  ops = distanceOp.actionsFor(selection, store, context);
  assertEquals("empty collection", 0, ops.size());

  selection.remove(len1);
  selection.add(singletonLoc.toDocument());
  ops = distanceOp.actionsFor(selection, store, context);
  assertEquals("empty collection", 0, ops.size());

  // ok, try adding some data
  loc1.add(1000, builder.createPoint(4, 3));
  singletonLoc.add(builder.createPoint(3, 4));

  // put in the new documents
  selection.clear();
  selection.add(loc1.toDocument());
  selection.add(singletonLoc.toDocument());

  ops = distanceOp.actionsFor(selection, store, context);
  assertEquals("not empty collection", 1, ops.size());

  assertEquals("store empty", 0, store.size());

  ops.get(0).execute();

  assertEquals("store no longer empty", 1, store.size());

  // check the output has the time units from the time provider
  NumberDocument output = (NumberDocument) ops.get(0).getOutputs().get(0);
  assertTrue("does not have index units", output.getIndexUnits() == null);

  // add some more entries to loc1
  loc1.add(2000, builder.createPoint(4, 3));
  loc1.add(3000, builder.createPoint(4, 3));
  loc1.add(4000, builder.createPoint(4, 3));

  // put in the new documents
  selection.clear();
  selection.add(loc1.toDocument());
  selection.add(singletonLoc.toDocument());

  ops = distanceOp.actionsFor(selection, store, context);
  assertEquals("not empty collection", 1, ops.size());

  // run the interpolation command
  store.clear();
  ops.get(0).execute();
  assertEquals("store has other collection", 1, store.size());

  // check that the results object is indexed
  output = (NumberDocument) ops.get(0).getOutputs().get(0);
  assertTrue("has index units", output.getIndexUnits() != null);
}
 
开发者ID:debrief,项目名称:limpet,代码行数:76,代码来源:TestGeotoolsGeometry.java

示例7: testLocationSingletonCalcBearing

public void testLocationSingletonCalcBearing()
{
  final LocationDocumentBuilder loc1 =
      new LocationDocumentBuilder("loc1", null, SI.MILLI(SI.SECOND));
  final LocationDocumentBuilder singletonLoc =
      new LocationDocumentBuilder("loc2", null, SI.MILLI(SI.SECOND));

  final IOperation bearingOp = new BearingBetweenTracksOperation();
  final IGeoCalculator builder = loc1.getCalculator();

  final List<IStoreItem> selection = new ArrayList<IStoreItem>();

  final StoreGroup store = new StoreGroup("Results");

  // ok, try adding some data
  loc1.add(1000, builder.createPoint(4, 3));
  singletonLoc.add(2000, builder.createPoint(3, 4));

  selection.add(loc1.toDocument());
  selection.add(singletonLoc.toDocument());

  // try the bearing operation
  List<ICommand> ops = bearingOp.actionsFor(selection, store, context);

  assertEquals("not empty collection", 1, ops.size());

  store.clear();
  assertEquals("store empty", 0, store.size());

  ops.get(0).execute();

  assertEquals("store no longer empty", 1, store.size());

  // try the bearing operation
  ops = bearingOp.actionsFor(selection, store, context);

  assertEquals("not empty collection", 1, ops.size());

  store.clear();
  assertEquals("store empty", 0, store.size());

  ops.get(0).execute();

  assertEquals("store no longer empty", 1, store.size());

  // add some more entries to loc1
  loc1.add(2000, builder.createPoint(4, 3));
  loc1.add(3000, builder.createPoint(4, 3));
  loc1.add(4000, builder.createPoint(4, 3));

  // put in the new documents
  selection.clear();
  selection.add(loc1.toDocument());
  selection.add(singletonLoc.toDocument());

  // run the interpolation command
  store.clear();
  ops.get(0).execute();
  assertEquals("store has other collection", 1, store.size());

  // try the bearing operation
  ops = bearingOp.actionsFor(selection, store, context);

  assertEquals("not empty collection", 1, ops.size());

  store.clear();
  assertEquals("store empty", 0, store.size());

  ops.get(0).execute();

  assertEquals("store no longer empty", 1, store.size());
}
 
开发者ID:debrief,项目名称:limpet,代码行数:72,代码来源:TestGeotoolsGeometry.java

示例8: getWithPrefix

/**
 * returns an new unit with the given Prefix
 *
 * @param pre
 * @param unit
 * @return
 */
public Unit getWithPrefix(String pre, Unit unit) {
    if (pre.equals(PrefixName.ATTO)) {
        return SI.ATTO(unit);
    } else if (pre.equals(PrefixName.CENTI)) {
        return SI.CENTI(unit);
    } else if (pre.equals(PrefixName.DECI)) {
        return SI.DECI(unit);
    } else if (pre.equals(PrefixName.DEKA)) {
        return SI.DEKA(unit);
    } else if (pre.equals(PrefixName.EXA)) {
        return SI.EXA(unit);
    } else if (pre.equals(PrefixName.FEMTO)) {
        return SI.FEMTO(unit);
    } else if (pre.equals(PrefixName.GIGA)) {
        return SI.GIGA(unit);
    } else if (pre.equals(PrefixName.HECTO)) {
        return SI.HECTO(unit);
    } else if (pre.equals(PrefixName.KILO)) {
        return SI.KILO(unit);
    } else if (pre.equals(PrefixName.MEGA)) {
        return SI.MEGA(unit);
    } else if (pre.equals(PrefixName.MICRO)) {
        return SI.MICRO(unit);
    } else if (pre.equals(PrefixName.MILLI)) {
        return SI.MILLI(unit);
    } else if (pre.equals(PrefixName.NANO)) {
        return SI.NANO(unit);
    } else if (pre.equals(PrefixName.PETA)) {
        return SI.PETA(unit);
    } else if (pre.equals(PrefixName.PICO)) {
        return SI.PICO(unit);
    } else if (pre.equals(PrefixName.YOCTO)) {
        return SI.YOCTO(unit);
    } else if (pre.equals(PrefixName.ZEPTO)) {
        return SI.ZEPTO(unit);
    } else if (pre.equals(PrefixName.ZETTA)) {
        return SI.ZETTA(unit);
    } else {
        return unit;
    }
}
 
开发者ID:OpenJEVis,项目名称:JECommons,代码行数:48,代码来源:UnitManager.java

示例9: getUnitWithPrefix

/**
     * Return an new Unit with the set Prefix
     *
     * @param unit
     * @param prefix
     * @return
     */
    public Unit getUnitWithPrefix(Unit unit, JEVisUnit.Prefix prefix) {
//        System.out.println("getUnitWithPrefix: " + prefix);
        switch (prefix) {
            case ATTO:
                return SI.ATTO(unit);
            case CENTI:
                return SI.CENTI(unit);
            case DECI:
                return SI.DECI(unit);
            case DEKA:
                return SI.DEKA(unit);
            case EXA:
                return SI.EXA(unit);
            case FEMTO:
                return SI.FEMTO(unit);
            case GIGA:
                return SI.GIGA(unit);
            case HECTO:
                return SI.HECTO(unit);
            case KILO:
                return SI.KILO(unit);
            case MEGA:
                return SI.MEGA(unit);
            case MICRO:
                return SI.MICRO(unit);
            case MILLI:
                return SI.MILLI(unit);
            case NANO:
                return SI.NANO(unit);
            case PETA:
                return SI.PETA(unit);
            case PICO:
                return SI.PICO(unit);
            case TERA:
                return SI.TERA(unit);
            case YOCTO:
                return SI.YOCTO(unit);
            case ZEPTO:
                return SI.ZEPTO(unit);
            case ZETTA:
                return SI.ZETTA(unit);
            case NONE:
                return unit;
            default:
                throw new AssertionError();
        }
    }
 
开发者ID:OpenJEVis,项目名称:JECommons,代码行数:54,代码来源:UnitManager.java

示例10: getTimeUnit

@Override
public Unit<Duration> getTimeUnit() {
  return SI.MILLI(SI.SECOND);
}
 
开发者ID:JDevlieghere,项目名称:MAS,代码行数:4,代码来源:BeaconGendreau06Scenario.java


注:本文中的javax.measure.unit.SI.MILLI属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。