org.modeshape.schematic.document.Document.getDouble()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(138)

本文整理了Java中org.modeshape.schematic.document.Document.getDouble()方法的一些代码示例,展示了Document.getDouble()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Document.getDouble()方法的具体详情如下:
包路径:org.modeshape.schematic.document.Document
类名称:Document
方法名:getDouble

Document.getDouble介绍

[英]Get the double value in this document for the given field name.
[中]获取此文档中给定字段名的双精度值。

代码示例

代码示例来源:origin: stackoverflow.com

MongoCollection<Document> dbCollection = db.getCollection("example", Document.class);
AggregateIterable<org.bson.Document> aggregate = dbCollection.aggregate(Arrays.asList(Aggregates.group("_id", new BsonField("averageAge", new BsonDocument("$avg", new BsonString("$age"))))));
Document result = aggregate.first();
double age = result.getDouble("averageAge");

代码示例来源:origin: ModeShape/modeshape

doc -> doc.getDouble("_score").floatValue(),
(v1, v2) -> v1,
LinkedHashMap::new));

代码示例来源:origin: ModeShape/modeshape

protected void addValidatorsForMaximum( Document parent,
                    Path parentPath,
                    Problems problems,
                    CompositeValidator validators ) {
  Double maximum = parent.getDouble("maximum");
  if (maximum != null) {
    String requiredName = parentPath.getLast();
    if (requiredName != null) {
      if (parent.getBoolean("exclusiveMinimum", Boolean.FALSE)) {
        validators.add(new ExclusiveMaximumValidator(requiredName, maximum));
      } else {
        validators.add(new MaximumValidator(requiredName, maximum));
      }
    }
  }
}

代码示例来源:origin: org.modeshape/modeshape-schematic

protected void addValidatorsForMaximum( Document parent,
                    Path parentPath,
                    Problems problems,
                    CompositeValidator validators ) {
  Double maximum = parent.getDouble("maximum");
  if (maximum != null) {
    String requiredName = parentPath.getLast();
    if (requiredName != null) {
      if (parent.getBoolean("exclusiveMinimum", Boolean.FALSE)) {
        validators.add(new ExclusiveMaximumValidator(requiredName, maximum));
      } else {
        validators.add(new MaximumValidator(requiredName, maximum));
      }
    }
  }
}

代码示例来源:origin: ModeShape/modeshape

assertThat(read2.getInteger("k2"), is(2));
assertThat(read2.getBoolean("k3"), is(true));
assertThat(read2.getDouble("k4") > 3.4d, is(true));

代码示例来源:origin: ModeShape/modeshape

assertThat(read2.getInteger("k2"), is(2));
assertThat(read2.getBoolean("k3"), is(true));
assertThat(read2.getDouble("k4") > 3.4d, is(true));

相关文章