Cursor getFloat - 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 getFloat 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
This code example shows how to use the following methods:getFloat
    return wrappedCursor.getLong(i);
  } 
 
  @Implementation 
  public float getFloat(int i) {
    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() { 
7
CodeRank
This code example shows how to use the following methods:getColumnIndex, getFloat
    } 
 
    public void checkCursorExtraRowFloat(float value) {
        String column = "extra_float";
        Cursor c = createCursorWithExtras(column, value);
        assertEquals("Extra column value", value, c.getFloat(c.getColumnIndex(column)));
    } 
 
    public void testCursorExtraRowLong() { 
        checkExtraRowLong(0xfeed0beefl); 
        checkExtraRowLong(-0xfeed0beefl); 
        checkExtraRowLong(0); 
        checkExtraRowLong(Long.MIN_VALUE);
        checkExtraRowLong(Long.MAX_VALUE);
    } 
 
    private void checkExtraRowLong(long value) {
        String column = "extra_long";
        Cursor c = createCursorWithExtras(column, value);
        assertEquals("Extra column value", value, c.getLong(c.getColumnIndex(column)));
6
CodeRank
This code example shows how to use the following methods:getFloat
    } 
 
    @Override 
    public float getFloat(int column)
    { 
        return mCursor.getFloat(column);
    } 
 
    @Override 
    public double getDouble(int column)
    { 
        return mCursor.getDouble(column);
    } 
 
    @Override 
    public int getType(int column) {
        return mCursor.getType(column);
    } 
 
    @Override 
7
CodeRank
This code example shows how to use the following methods:getFloat
    } 
 
    @Override 
    public float getFloat(int column)
    { 
        return mCursor.getFloat(column);
    } 
 
    @Override 
    public double getDouble(int column)
    { 
        return mCursor.getDouble(column);
    } 
 
    @Override 
    public int getType(int column) {
        return mCursor.getType(column);
    } 
 
    @Override 
6
CodeRank
This code example shows how to use the following methods:getFloat, getInt, getLong, getString
		 
		SIPIdentity sipIdentity = new SIPIdentity();
		 
		int i = 0;
		 
		sipIdentity.setId(cursor.getLong(i++));
		sipIdentity.setUri(cursor.getString(i++));
		sipIdentity.setEnable(fromBoolean(cursor.getInt(i++)));
		sipIdentity.setAuthUser(cursor.getString(i++));
		sipIdentity.setAuthPassword(cursor.getString(i++));
		sipIdentity.setMwi(fromBoolean(cursor.getInt(i++)));
		sipIdentity.setMMTel(fromBoolean(cursor.getInt(i++)));
		sipIdentity.setReg(fromBoolean(cursor.getInt(i++)));
		sipIdentity.setQ(cursor.getFloat(i++));
		sipIdentity.setRegServerName(cursor.getString(i++));
		sipIdentity.setRegServerPort(cursor.getInt(i++));
		sipIdentity.setRegServerProtocol(cursor.getString(i++));
		sipIdentity.setOutbound(fromBoolean(cursor.getInt(i++)));
		sipIdentity.setOutboundServerName(cursor.getString(i++));
		sipIdentity.setOutboundServerPort(cursor.getInt(i++));

6
CodeRank
This code example shows how to use the following methods:getFloat
        return wrappedCursor.getLong(i);
    } 
 
    @Implementation 
    public float getFloat(int i) {
        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() { 
6
CodeRank
This code example shows how to use the following methods:getFloat, getInt, getString
		mColOrdre = c.getColumnIndex(ArretTable.ORDRE);
	} 
 
	@Override 
	public Arret getSingleFromCursor(final Cursor c) {
		mBuilder.setId(c.getInt(mColId));
		mBuilder.setCodeArret(c.getString(mColCodeArret));
		mBuilder.setLettre(c.getString(mColLettre));
		mBuilder.setCodeEquipement(c.getString(mColCodeEquipement));
		mBuilder.setCodeLigne(c.getString(mColCodeLigne));
		mBuilder.setCodeSens(c.getString(mColCodeSens));
		mBuilder.setNomArret(c.getString(mColNomArret));
		mBuilder.setNormalizedNom(c.getString(mColNormalizedNom));
		mBuilder.setLatitude(c.getFloat(mColLatitude));
		mBuilder.setLongitude(c.getFloat(mColLongitude));
		mBuilder.setIdStation(c.getInt(mColIdStation));
		mBuilder.setOrdre(c.getInt(mColOrdre));
		return mBuilder.build();
	} 
 

6
CodeRank
This code example shows how to use the following methods:getFloat
        return mActiveCursor.getDouble(columnIndex);
    } 
 
    @Override 
    public float getFloat(int columnIndex) {
        return mActiveCursor.getFloat(columnIndex);
    } 
 
    @Override 
    public int getInt(int columnIndex) {
        return mActiveCursor.getInt(columnIndex);
    } 
 
    @Override 
    public long getLong(int columnIndex) {
        return mActiveCursor.getLong(columnIndex);
    } 
 
    @Override 
    public int getPosition() { 
6
CodeRank
This code example shows how to use the following methods:getColumnIndex, getFloat
    } 
 
    public void checkCursorExtraRowFloat(float value) {
        String column = "extra_float";
        Cursor c = createCursorWithExtras(column, value);
        assertEquals("Extra column value", value, c.getFloat(c.getColumnIndex(column)));
    } 
 
    public void testCursorExtraRowLong() { 
        checkExtraRowLong(0xfeed0beefl); 
        checkExtraRowLong(-0xfeed0beefl); 
        checkExtraRowLong(0); 
        checkExtraRowLong(Long.MIN_VALUE);
        checkExtraRowLong(Long.MAX_VALUE);
    } 
 
    private void checkExtraRowLong(long value) {
        String column = "extra_long";
        Cursor c = createCursorWithExtras(column, value);
        assertEquals("Extra column value", value, c.getLong(c.getColumnIndex(column)));
5
CodeRank

Related Cursor getFloat Questions & Answers:

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