com.datastax.driver.core.Row.getDouble()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(93)

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

Row.getDouble介绍

[英]Returns the ith value of this row as a double.
[中]以双精度形式返回此行的第i个值。

代码示例

代码示例来源:origin: prestodb/presto

@Override
public double getDouble(int i)
{
  switch (getCassandraType(i)) {
    case DOUBLE:
      return currentRow.getDouble(i);
    case FLOAT:
      return currentRow.getFloat(i);
    case DECIMAL:
      return currentRow.getDecimal(i).doubleValue();
    default:
      throw new IllegalStateException("Cannot retrieve double for " + getCassandraType(i));
  }
}

代码示例来源:origin: prestodb/presto

return Boolean.toString(row.getBool(i));
case DOUBLE:
  return Double.toString(row.getDouble(i));
case FLOAT:
  return Float.toString(row.getFloat(i));

代码示例来源:origin: apache/ignite

return row.isNull(col) ? null : row.getDouble(col);
return row.getDouble(col);

代码示例来源:origin: apache/nifi

return row.getDouble(i);

代码示例来源:origin: prestodb/presto

return NullableValue.of(nativeType, row.getBool(i));
case DOUBLE:
  return NullableValue.of(nativeType, row.getDouble(i));
case FLOAT:
  return NullableValue.of(nativeType, (long) floatToRawIntBits(row.getFloat(i)));

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

private void assertRow(Row row) {
  assertThat(row.getInt(0)).isEqualTo(n_int);
  assertThat(row.getLong(1)).isEqualTo(n_bigint);
  assertThat(row.getFloat(2)).isEqualTo(n_float);
  assertThat(row.getDouble(3)).isEqualTo(n_double);
  assertThat(row.getVarint(4)).isEqualTo(n_varint);
  assertThat(row.getDecimal(5)).isEqualTo(n_decimal);
  // with getObject
  assertThat(row.getObject(0)).isEqualTo(n_int);
  assertThat(row.getObject(1)).isEqualTo(n_bigint);
  assertThat(row.getObject(2)).isEqualTo(n_float);
  assertThat(row.getObject(3)).isEqualTo(n_double);
  assertThat(row.getObject(4)).isEqualTo(n_varint);
  assertThat(row.getObject(5)).isEqualTo(n_decimal);
  // with get + type
  assertThat(row.get(0, Integer.class)).isEqualTo(n_int);
  assertThat(row.get(1, Long.class)).isEqualTo(n_bigint);
  assertThat(row.get(2, Float.class)).isEqualTo(n_float);
  assertThat(row.get(3, Double.class)).isEqualTo(n_double);
  assertThat(row.get(4, BigInteger.class)).isEqualTo(n_varint);
  assertThat(row.get(5, BigDecimal.class)).isEqualTo(n_decimal);
 }
}

代码示例来源:origin: Impetus/Kundera

retVal = row.getDouble(columnName);
setFieldValue(entity, member, retVal);
break;

代码示例来源:origin: jsevellec/cassandra-unit

@Override
public double getDouble(int i)
{
  return row.getDouble(i);
}

代码示例来源:origin: jsevellec/cassandra-unit

@Override
public double getDouble(String name)
{
  return row.getDouble(name);
}

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

this.readRepair = row.getDouble(READ_REPAIR);
if (is300OrHigher) this.localReadRepair = row.getDouble(DCLOCAL_READ_REPAIR);
else this.localReadRepair = row.getDouble(LOCAL_READ_REPAIR);
this.gcGrace = row.getInt(GC_GRACE);
this.bfFpChance =
  isNullOrAbsent(row, BF_FP_CHANCE) ? DEFAULT_BF_FP_CHANCE : row.getDouble(BF_FP_CHANCE);
   isNullOrAbsent(row, CRC_CHECK_CHANCE)
     ? DEFAULT_CRC_CHECK_CHANCE
     : row.getDouble(CRC_CHECK_CHANCE);
else this.crcCheckChance = null;

代码示例来源:origin: org.apache.cassandra/cassandra-all

@Override
public double getDouble(int i)
{
  return row.getDouble(i);
}

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server

@Override
public double getDouble(int i)
{
  return row.getDouble(i);
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

@Override
public double getDouble(String name)
{
  return row.getDouble(name);
}

代码示例来源:origin: com.tuplejump/calliope-core

@Override
public double getDouble(String name) {
  return row.getDouble(name);
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

@Override
public double getDouble(String name)
{
  return row.getDouble(name);
}

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

assertThat(row.getLong(1)).isEqualTo(n_bigint);
assertThat(row.getFloat(2)).isEqualTo(n_float);
assertThat(row.getDouble(3)).isEqualTo(n_double);
assertThat(row.getVarint(4)).isEqualTo(n_varint);
assertThat(row.getDecimal(5)).isEqualTo(n_decimal);

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

assertThat(row.getDouble("bloom_filter_fp_chance")).isEqualTo(0.42);
assertThat(row.getString("caching"))
  .isEqualTo("{\"keys\":\"ALL\", \"rows_per_partition\":\"1\"}");
assertThat(row.getInt("max_index_interval")).isEqualTo(8);
assertThat(row.getString("key_aliases")).isEqualTo("[\"a\",\"b\"]");
assertThat(row.getDouble("local_read_repair_chance")).isEqualTo(0.84);
assertThat(row.getInt("max_compaction_threshold")).isEqualTo(3);
assertThat(row.getInt("memtable_flush_period_in_ms")).isEqualTo(1234567890);
assertThat(row.getInt("min_compaction_threshold")).isEqualTo(2);
assertThat(row.getDouble("read_repair_chance")).isEqualTo(0.123456);
assertThat(row.getString("speculative_retry")).isEqualTo("50.0PERCENTILE");

代码示例来源:origin: org.hawkular.metrics/hawkular-metrics-core-service

public static DataPoint<Double> getTempGaugeDataPoint(Row row) {
  return new DataPoint<>(
      row.getTimestamp(GAUGE_COLS.TIME.ordinal()).toInstant().toEpochMilli(),
      row.getDouble(GAUGE_COLS.VALUE.ordinal()),
      row.getMap(GAUGE_COLS.TAGS.ordinal(), String.class, String.class));
}

代码示例来源:origin: hawkular/hawkular-metrics

public static DataPoint<Double> getGaugeDataPoint(Row row) {
  return new DataPoint<>(
      UUIDs.unixTimestamp(row.getUUID(GAUGE_COLS.TIME.ordinal())),
      row.getDouble(GAUGE_COLS.VALUE.ordinal()),
      row.getMap(GAUGE_COLS.TAGS.ordinal(), String.class, String.class));
}

代码示例来源:origin: org.hawkular.metrics/hawkular-metrics-core-service

public static DataPoint<Double> getGaugeDataPoint(Row row) {
  return new DataPoint<>(
      UUIDs.unixTimestamp(row.getUUID(GAUGE_COLS.TIME.ordinal())),
      row.getDouble(GAUGE_COLS.VALUE.ordinal()),
      row.getMap(GAUGE_COLS.TAGS.ordinal(), String.class, String.class));
}

相关文章