Cursor isNull - 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 isNull method.

This code example shows how to use the following methods:getInt, getLong, getString, isNull
 
    /** @inheritdoc */ 
    @Override 
    public SpecialNamesEntity readEntity(Cursor cursor, int offset) {
        SpecialNamesEntity entity = new SpecialNamesEntity( //
            cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
            cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // count
            cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // select
            cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // sum
            cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // avg
            cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // join
            cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // distinct
            cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // on
            cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // index
            cursor.isNull(offset + 9) ? null : cursor.getInt(offset + 9) // order
        ); 
        return entity;
    } 
      
    /** @inheritdoc */ 
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getColumnIndex, getInt, getLong, getString, isNull
        final boolean validIcon = mResPackage != null && mIconRes != -1;
        return validIcon ? pm.getDrawable(mResPackage, mIconRes, null) : null;
    } 
 
    private static String getString(Cursor cursor, String columnName) {
        return cursor.getString(cursor.getColumnIndex(columnName));
    } 
 
    private static int getInt(Cursor cursor, String columnName) {
        return cursor.getInt(cursor.getColumnIndex(columnName));
    } 
 
    private static int getInt(Cursor cursor, String columnName, int missingValue) {
        final int columnIndex = cursor.getColumnIndex(columnName);
        return cursor.isNull(columnIndex) ? missingValue : cursor.getInt(columnIndex);
    } 
 
    private static long getLong(Cursor cursor, String columnName, long missingValue) {
        final int columnIndex = cursor.getColumnIndex(columnName);
        return cursor.isNull(columnIndex) ? missingValue : cursor.getLong(columnIndex);

8
CodeRank
Experience pair programming with AI  Get Codota for Java
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:getColumnIndex, getInt, getLong, getString, isNull
        final boolean validIcon = mResPackage != null && mIconRes != -1;
        return validIcon ? pm.getDrawable(mResPackage, mIconRes, null) : null;
    } 
 
    private static String getString(Cursor cursor, String columnName) {
        return cursor.getString(cursor.getColumnIndex(columnName));
    } 
 
    private static int getInt(Cursor cursor, String columnName) {
        return cursor.getInt(cursor.getColumnIndex(columnName));
    } 
 
    private static int getInt(Cursor cursor, String columnName, int missingValue) {
        final int columnIndex = cursor.getColumnIndex(columnName);
        return cursor.isNull(columnIndex) ? missingValue : cursor.getInt(columnIndex);
    } 
 
    private static long getLong(Cursor cursor, String columnName, long missingValue) {
        final int columnIndex = cursor.getColumnIndex(columnName);
        return cursor.isNull(columnIndex) ? missingValue : cursor.getLong(columnIndex);

8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getInt, isNull
        view.showPhoneticName(cursor, PHONE_PHONETIC_NAME_COLUMN_INDEX);
    } 
 
    protected void bindPhoneNumber(ContactListItemView view, Cursor cursor) {
        CharSequence label = null;
        if (!cursor.isNull(PHONE_TYPE_COLUMN_INDEX)) {
            final int type = cursor.getInt(PHONE_TYPE_COLUMN_INDEX);
            final String customLabel = cursor.getString(PHONE_LABEL_COLUMN_INDEX);
 
            // TODO cache 
            label = Phone.getTypeLabel(getContext().getResources(), type, customLabel);
        } 
        view.setLabel(label);
        view.showData(cursor, PHONE_NUMBER_COLUMN_INDEX);
    } 
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getLong, isNull
    } 
 
    /** @inheritdoc */ 
    @Override 
    public Long readKey(Cursor cursor, int offset) {
        return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
    }     
 
    /** @inheritdoc */ 
    @Override 
    public AutoincrementEntity readEntity(Cursor cursor, int offset) {
        AutoincrementEntity entity = new AutoincrementEntity( //
            cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0) // id
        ); 
        return entity;
    } 
      
    /** @inheritdoc */ 
    @Override 
    public void readEntity(Cursor cursor, AutoincrementEntity entity, int offset) {
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getInt, isNull
        view.showPhoneticName(cursor, POSTAL_PHONETIC_NAME_COLUMN_INDEX);
    } 
 
    protected void bindPostalAddress(ContactListItemView view, Cursor cursor) {
        CharSequence label = null;
        if (!cursor.isNull(POSTAL_TYPE_COLUMN_INDEX)) {
            final int type = cursor.getInt(POSTAL_TYPE_COLUMN_INDEX);
            final String customLabel = cursor.getString(POSTAL_LABEL_COLUMN_INDEX);
 
            // TODO cache 
            label = StructuredPostal.getTypeLabel(getContext().getResources(), type, customLabel);
        } 
        view.setLabel(label);
        view.showData(cursor, POSTAL_NUMBER_COLUMN_INDEX);
    } 
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:isNull
    return wrappedCursor.getDouble(i);
  } 
 
  @Implementation 
  public boolean isNull(int i) {
    return wrappedCursor.isNull(i);
  } 
 
  @Implementation 
  public void deactivate() { 
    wrappedCursor.deactivate();
  } 
 
  @Implementation 
  public boolean requery() { 
    return wrappedCursor.requery();
  } 
 
  @Implementation 
  public void close() { 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getColumnIndex, getLong, isNull
This code example shows how to use the following methods:isNull
    } 
 
    @Override 
    public boolean isNull(int column)
    { 
        return mCursor.isNull(column);
    } 
 
    @Override 
    public byte[] getBlob(int column)
    { 
        return mCursor.getBlob(column);   
    } 
     
    @Override 
    public String[] getColumnNames()
    { 
        if (mCursor != null) {
            return mCursor.getColumnNames();
        } else { 
7
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Cursor isNull Questions & Answers:

isNull Method Overview
Returns true if the value in the indicated column is null.
See Code Examples for other Android Cursor Methods: