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

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

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

Row.getFloat介绍

[英]Returns the ith value of this row as a float.
[中]以浮点形式返回此行的第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

@Override
public long getLong(int i)
{
  switch (getCassandraType(i)) {
    case INT:
      return currentRow.getInt(i);
    case BIGINT:
    case COUNTER:
      return currentRow.getLong(i);
    case TIMESTAMP:
      return currentRow.getTimestamp(i).getTime();
    case FLOAT:
      return floatToRawIntBits(currentRow.getFloat(i));
    default:
      throw new IllegalStateException("Cannot retrieve long for " + getCassandraType(i));
  }
}

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

return Double.toString(row.getDouble(i));
case FLOAT:
  return Float.toString(row.getFloat(i));
case DECIMAL:
  return row.getDecimal(i).toString();

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

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

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

return row.getFloat(i);

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

return NullableValue.of(nativeType, row.getDouble(i));
case FLOAT:
  return NullableValue.of(nativeType, (long) floatToRawIntBits(row.getFloat(i)));
case DECIMAL:
  return NullableValue.of(nativeType, row.getDecimal(i).doubleValue());

代码示例来源: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.getFloat(columnName);
setFieldValue(entity, member, retVal);
break;

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

@Override
public float getFloat(String name)
{
  return row.getFloat(name);
}

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

@Override
public float getFloat(String name)
{
  return row.getFloat(name);
}

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

@Override
public float getFloat(String name)
{
  return row.getFloat(name);
}

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

@Override
public float getFloat(int i)
{
  return row.getFloat(i);
}

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

@Override
public float getFloat(int i)
{
  return row.getFloat(i);
}

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

@Override
public float getFloat(int i) {
  return row.getFloat(i);
}

代码示例来源:origin: net.oneandone/troilus-core-java7

@Override
public Float getFloat(String name) {
  return row.getFloat(name);
}

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

assertThat(row.getFloat(2)).isEqualTo(n_float);
assertThat(row.getDouble(3)).isEqualTo(n_double);
assertThat(row.getVarint(4)).isEqualTo(n_varint);

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

static void checkExecuteResultSet(ResultSet rs, String key) {
 assertThat(rs.isExhausted()).isFalse();
 Row row = rs.one();
 assertThat(rs.isExhausted()).isTrue();
 assertThat(row.getString("k")).isEqualTo(key);
 assertThat(row.getString("t")).isEqualTo("foo");
 assertThat(row.getInt("i")).isEqualTo(42);
 assertThat(row.getFloat("f")).isEqualTo(24.03f, offset(0.1f));
}

代码示例来源:origin: adejanovski/cassandra-jdbc-wrapper

public float getFloat(String name) throws SQLException
{
  checkName(name);
  return currentRow.getFloat(name);
}

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

Row row = ar.one();
assertThat(row.getColumnDefinitions().getType("iavg")).isEqualTo(DataType.cfloat());
Float f = row.getFloat("iavg");

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

static void checkExecuteResultSet(ResultSet rs, String key) {
 assertThat(rs.isExhausted()).isFalse();
 Row row = rs.one();
 assertThat(rs.isExhausted()).isTrue();
 assertThat(row.getString("k")).isEqualTo(key);
 assertThat(row.getString("t")).isEqualTo("foo");
 assertThat(row.getInt("i")).isEqualTo(42);
 assertThat(row.getFloat("f")).isEqualTo(24.03f, offset(0.1f));
}

相关文章