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

This code example shows how to use the following methods:getCount, getPosition, isAfterLast, isBeforeFirst, moveToFirst
		return cursor.getColumnName(column - 1);
	} 
 
	@Override 
    public int getColumnType(int column) throws SQLException {
        int oldPos = cursor.getPosition();
        boolean moved = false;
        if (cursor.isBeforeFirst() || cursor.isAfterLast()) {
            boolean resultSetEmpty = cursor.getCount() == 0 || cursor.isAfterLast();
            if (resultSetEmpty) {
                return Types.NULL;
            } 
            cursor.moveToFirst();
            moved = true;
        } 
        int nativeType = getType(cursor, column - 1);
        int type;
        switch (nativeType) {
        case 0: // Cursor.FIELD_TYPE_NULL: 
            type = Types.NULL;

7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getInt, getString, isAfterLast, isBeforeFirst, isClosed
		} 
	} 
 
	@Override 
	public Segment loadFromCursor(Cursor cursor) {
		if (cursor.isBeforeFirst() || cursor.isAfterLast() || cursor.isClosed()) {
			throw new IllegalArgumentException();
		} 
 
		SimpleDateFormat sdf = new SimpleDateFormat(LAST_UPDATE_FORMAT);
		Segment segment = new Segment();
		int index = 1; // 0 == _ID
 
		segment.setName(cursor.getString(index++));
		segment.setColorId(cursor.getInt(index++));
		try { 
			segment.setLastUpdate(sdf.parse(cursor.getString(index++)));
		} catch (ParseException e) {
			segment.setLastUpdate(null);
		} 

7
CodeRank
Contextual code suggestions in your IDE  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
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getCount, isBeforeFirst, moveToFirst
	private Integer _pubDateColumn = null;
	private Integer _paymentColumn = null;
 
	public PodcastCursor(Cursor cursor) {
		_cursor = cursor;
		if (_cursor.getCount() == 0)
			return; 
		if (_cursor.isBeforeFirst())
			_cursor.moveToFirst();
	} 
 
	public boolean isNull() { 
		return _cursor.isAfterLast();
	} 
 
	public Uri getContentUri() {
		return ContentUris.withAppendedId(PodcastProvider.URI, getId());
	} 
 
	public long getId() { 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:isBeforeFirst
    return wrappedCursor.isLast();
  } 
 
  @Implementation 
  public boolean isBeforeFirst() { 
    return wrappedCursor.isBeforeFirst();
  } 
 
  @Implementation 
  public boolean isAfterLast() { 
    return wrappedCursor.isAfterLast();
  } 
 
  @Implementation 
  public int getColumnIndex(String s) {
    return wrappedCursor.getColumnIndex(s);
  } 
 
  @Implementation 
  public int getColumnIndexOrThrow(String s) throws IllegalArgumentException {
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:isBeforeFirst
        return wrappedCursor.isLast();
    } 
 
    @Implementation 
    public boolean isBeforeFirst() { 
        return wrappedCursor.isBeforeFirst();
    } 
 
    @Implementation 
    public boolean isAfterLast() { 
        return wrappedCursor.isAfterLast();
    } 
 
    @Implementation 
    public int getColumnIndex(String s) {
        return wrappedCursor.getColumnIndex(s);
    } 
 
    @Implementation 
    public int getColumnIndexOrThrow(String s) throws IllegalArgumentException {
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:isAfterLast, isBeforeFirst, isClosed
        return mInflater.inflate(R.layout.p2p_peer_item, parent, false);
    } 
 
    private boolean isCursorValid(Cursor cursor) {
        // Check whether the cursor is valid or not. 
        if (cursor == null || cursor.isClosed() || cursor.isBeforeFirst() || cursor.isAfterLast()) {
            return false; 
        } 
        return true; 
    } 
     
    public Peer getCachedPeer(long msgId, Cursor c) {
        Peer item = mPeerCache.get(msgId);
        if (item == null && c != null && isCursorValid(c)) {
            item = new Peer(c, mColumnsMap);
            mPeerCache.put(msgId, item);
        } 
        return item;
    } 
     
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:isBeforeFirst
	return cursor.isLast();
    } 
 
    @Implementation 
    public boolean isBeforeFirst() { 
	return cursor.isBeforeFirst();
    } 
 
    @Implementation 
    public boolean isAfterLast() { 
	return cursor.isAfterLast();
    } 
 
    @Implementation 
    public int getColumnIndex(String columnName) {
	return cursor.getColumnIndex(columnName);
    } 
 
    @Implementation 
    public int getColumnIndexOrThrow(String columnName) {
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:isBeforeFirst
	/* (non-Javadoc) 
	 * @see android.database.Cursor#isBeforeFirst() 
	 */ 
	@Override 
	public boolean isBeforeFirst() { 
		return mCursor.isBeforeFirst();
	} 
 
	/* (non-Javadoc) 
	 * @see android.database.Cursor#isClosed() 
	 */ 
	@Override 
	public boolean isClosed() {		 
		return mCursor.isClosed();
	} 
 
	/* (non-Javadoc) 
	 * @see android.database.Cursor#isFirst() 
	 */ 
	@Override 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:isBeforeFirst
	public boolean isAfterLast() { 
		return internalCursor.isAfterLast();
	} 
 
	public boolean isBeforeFirst() { 
		return internalCursor.isBeforeFirst();
	} 
 
	public boolean isClosed() { 
		return internalCursor.isClosed();
	} 
 
	public boolean isFirst() { 
		return internalCursor.isFirst();
	} 
 
	public boolean isLast() { 
		return internalCursor.isLast();
	} 
 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Cursor isBeforeFirst Questions & Answers:

isBeforeFirst Method Overview
Returns whether the cursor is pointing to the position before the first row.
See Code Examples for other Android Cursor Methods: