Code example for Cursor

Methods: closemoveToPosition

0
                        entity = loadEntity(location);
                        entities.set(location, entity);
                        // Ignore FindBugs: increment of volatile is fine here because we use a lock 
                        loadedCount++;
                        if (loadedCount == size) {
                            cursor.close();
                        } 
                    } 
                } finally { 
                    lock.unlock();
                } 
            } 
            return entity;
        } else { 
            return loadEntity(location);
        } 
    } 
 
    protected E loadEntity(int location) {
        cursor.moveToPosition(location);
        E entity = daoAccess.loadCurrent(cursor, 0, true);
        if (entity == null) {
            throw new DaoException("Loading of entity failed (null) at position " + location);
        } 
        return entity;
    }