class TypeConvertingSqlAccessor implements SqlAccessor {

  @Override
  public double getDouble( int rowOffset ) throws InvalidAccessException {
    final double result;
    switch ( getType().getMinorType() ) {
      // 1. Regular type:
      case FLOAT8:
        result = innerAccessor.getDouble( rowOffset );
        break;

      // 2. Converted-from types:
      case INT:
        result = innerAccessor.getInt( rowOffset );
        break;
      case BIGINT:
        result = innerAccessor.getLong( rowOffset );
        break;
      case FLOAT4:
        result = innerAccessor.getFloat( rowOffset );
        break;
      case VARDECIMAL:
        result = innerAccessor.getBigDecimal(rowOffset).doubleValue();
        break;

      // 3. Not-yet-converted and unconvertible types:
      default:
        result = innerAccessor.getLong( rowOffset );
        //break;
    }
    return result;
  }

  public  TypeConvertingSqlAccessor( SqlAccessor innerAccessor );

}