Cursor getDouble - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Cursor getDouble method.

This code example shows how to use the following methods:getBlob, getDouble, getFloat, getInt, getLong
 
    /** @inheritdoc */ 
    @Override 
    public SimpleEntity readEntity(Cursor cursor, int offset) {
        SimpleEntity entity = new SimpleEntity( //
            cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
            cursor.isNull(offset + 1) ? null : cursor.getShort(offset + 1) != 0, // simpleBoolean
            cursor.isNull(offset + 2) ? null : (byte) cursor.getShort(offset + 2), // simpleByte
            cursor.isNull(offset + 3) ? null : cursor.getShort(offset + 3), // simpleShort
            cursor.isNull(offset + 4) ? null : cursor.getInt(offset + 4), // simpleInt
            cursor.isNull(offset + 5) ? null : cursor.getLong(offset + 5), // simpleLong
            cursor.isNull(offset + 6) ? null : cursor.getFloat(offset + 6), // simpleFloat
            cursor.isNull(offset + 7) ? null : cursor.getDouble(offset + 7), // simpleDouble
            cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // simpleString
            cursor.isNull(offset + 9) ? null : cursor.getBlob(offset + 9) // simpleByteArray
        ); 
        return entity;
    } 
      
    /** @inheritdoc */ 
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getDouble, getInt, getString, isAfterLast, isBeforeFirst
	// 
	// METHODES DE TRAITEMENTS DE CURSOR 
	// 
 
	public ParkingEntity loadFromCursor(Cursor cursor) {
		if (cursor.isBeforeFirst() || cursor.isAfterLast() || cursor.isClosed()) {
			throw new IllegalArgumentException();
		} 
 
		ParkingEntity park = new ParkingEntity();
		int index = 1; // 0 == _ID
 
		park.setIdentifiant(cursor.getString(index++));
		park.setNom(cursor.getString(index++));
		park.setStatut(cursor.getInt(index++));
		park.setPriorite(cursor.getInt(index++));
		park.setDisponibles(cursor.getInt(index++));
		park.setSeuilComplet(cursor.getInt(index++));
		park.setPlacesTotales(cursor.getInt(index++));
		park.setHoraires(cursor.getString(index++));

7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:close, getDouble, getLong, moveToNext
 
        ContentResolver contentResolver = context.getContentResolver();
        Cursor cursor = null;
        try { 
            cursor = contentResolver.query(sourceUri, IMAGE_PROJECTION, null, null, null);
            if ((cursor != null) && cursor.moveToNext()) {
                dateTaken = cursor.getLong(INDEX_DATE_TAKEN);
                latitude = cursor.getDouble(INDEX_LATITUDE);
                longitude = cursor.getDouble(INDEX_LONGITUDE);
            } 
        } catch (Exception e) {
            // Ignore error for lacking property columns from the source. 
        } finally { 
            if (cursor != null) {
                cursor.close();
            } 
        } 
 
        ContentValues values = new ContentValues();
        values.put(Images.Media.TITLE, saveFileName);
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getDouble
    return wrappedCursor.getFloat(i);
  } 
 
  @Implementation 
  public double getDouble(int i) {
    return wrappedCursor.getDouble(i);
  } 
 
  @Implementation 
  public boolean isNull(int i) {
    return wrappedCursor.isNull(i);
  } 
 
  @Implementation 
  public void deactivate() { 
    wrappedCursor.deactivate();
  } 
 
  @Implementation 
  public boolean requery() { 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:close, getDouble, moveToNext
 
	public Point getPoint(long id) {
		Point p = null;
		Cursor cursor = mResolver.query(
				ContentUris.withAppendedId(Locations.CONTENT_URI, id),
				new String[] { Locations._ID, Locations.LATITUDE,
						Locations.LONGITUDE }, null, null,
				Locations.DEFAULT_SORT_ORDER);
		if (cursor.moveToNext()) {
			int lat = Double.valueOf(cursor.getDouble(1) * 1E6).intValue();
			int lon = Double.valueOf(cursor.getDouble(2) * 1E6).intValue();
			p = new Point(lat, lon);
		} else { 
		} 
		cursor.close();
		return p;
	} 
 
	/** 
	 * @deprecated !! Warning !! Cursor has to be closed by caller. Alternative 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getColumnIndex, getDouble
    } 
 
    public void checkCursorExtraRowDouble(double value) {
        String column = "extra_double";
        Cursor c = createCursorWithExtras(column, value);
        assertEquals("Extra column value", value, c.getDouble(c.getColumnIndex(column)));
    } 
 
    public void testCursorExtraRowFloat() { 
        checkCursorExtraRowFloat((float) Math.E);
        checkCursorExtraRowFloat((float) -Math.E);
        checkCursorExtraRowFloat(0f); 
        checkCursorExtraRowFloat(Float.MAX_VALUE);
        checkCursorExtraRowFloat(Float.MIN_VALUE);
    } 
 
    public void checkCursorExtraRowFloat(float value) {
        String column = "extra_float";
        Cursor c = createCursorWithExtras(column, value);
        assertEquals("Extra column value", value, c.getFloat(c.getColumnIndex(column)));
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getDouble
    } 
 
    @Override 
    public double getDouble(int column)
    { 
        return mCursor.getDouble(column);
    } 
 
    @Override 
    public int getType(int column) {
        return mCursor.getType(column);
    } 
 
    @Override 
    public boolean isNull(int column)
    { 
        return mCursor.isNull(column);
    } 
 
    @Override 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getColumnIndex, getDouble
	public static double getDouble(Cursor cursor, Column column) {
		return getDouble(cursor, column.getLabel());
	} 
	 
	public static double getDouble(Cursor cursor, String column) {
		return cursor.getDouble(cursor.getColumnIndex(column));
	} 
 
	private static class SceneDataBaseHelper extends SQLiteOpenHelper {
 
		public static final String DATABASE_NAME = "scenedb";
		public static final int DATABASE_VERSION = 1001;
		 
		public SceneDataBaseHelper(Context context) {
			super(context, DATABASE_NAME, null, DATABASE_VERSION);
		} 
 
		@Override 
		public void onCreate(SQLiteDatabase db) {
			StringBuilder create = new StringBuilder("create table " + TABLE_SCENES + " (");
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getDouble
    } 
 
    @Override 
    public double getDouble(int column)
    { 
        return mCursor.getDouble(column);
    } 
 
    @Override 
    public int getType(int column) {
        return mCursor.getType(column);
    } 
 
    @Override 
    public boolean isNull(int column)
    { 
        return mCursor.isNull(column);
    } 
 
    @Override 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getDouble
        return wrappedCursor.getFloat(i);
    } 
 
    @Implementation 
    public double getDouble(int i) {
        return wrappedCursor.getDouble(i);
    } 
 
    @Implementation 
    public boolean isNull(int i) {
        return wrappedCursor.isNull(i);
    } 
 
    @Implementation 
    public void deactivate() { 
        wrappedCursor.deactivate();
    } 
 
    @Implementation 
    public boolean requery() { 
6
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Cursor getDouble Questions & Answers:

getDouble Method Overview
Returns the value of the requested column as a double.
See Code Examples for other Android Cursor Methods: