@Override public int getColumnIndex(String columnName) { if ("_id".equals(columnName)) { return super.getColumnIndex("id"); } return super.getColumnIndex(columnName); }
@Override public boolean moveToPosition(int position) { if (mHiddenRows.isEmpty()) { return super.moveToPosition(position); } mPosition = position; int newPosition = position; for (int hiddenRow : mHiddenRows) { if (hiddenRow > newPosition) { break; } newPosition++; } return super.moveToPosition(newPosition); }
@Test @Config(manifest = Config.NONE, shadows = ShadowCursorWrapperEcho.class) public void getTypeEcho() { assertThat(new CursorWrapper(null).getType(expectedType)).isEqualTo(expectedType); }
/** */ @Override public boolean moveToNext() { this.savePosition(); boolean result = super.moveToNext(); if (result && hasPositionChanged()) { result = bindData(); } else if (!result) { this.clearData(); } this.clearSavedPosition(); return result; }
@Override public void close() { super.close(); mDb.close(); }
/** */ @Override public boolean moveToPrevious() { this.savePosition(); boolean result = super.moveToPrevious(); if (result && hasPositionChanged()) { result = bindData(); } else if (!result) { this.clearData(); } this.clearSavedPosition(); return result; }
/** */ @Override public boolean moveToFirst() { this.savePosition(); boolean result = super.moveToFirst(); if (result && hasPositionChanged()) { result = bindData(); } else if (!result) { this.clearData(); } this.clearSavedPosition(); return result; }
/** */ @Override public boolean moveToLast() { this.savePosition(); boolean result = super.moveToLast(); if (result && hasPositionChanged()) { result = bindData(); } else if (!result) { this.clearData(); } this.clearSavedPosition(); return result; }
/** */ @Override public boolean move(int offset) { this.savePosition(); boolean result = super.move(offset); if (result && hasPositionChanged()) { result = bindData(); } else if (!result) { this.clearData(); } this.clearSavedPosition(); return result; }
@Override public int getType(int columnIndex) { int realColumnIndex = mColumnMapping[columnIndex]; if (realColumnIndex < 0) { return FIELD_TYPE_STRING; } return super.getType(realColumnIndex); }
/** */ @Override public boolean moveToNext() { this.savePosition(); boolean result = super.moveToNext(); if (result && hasPositionChanged()) { result = bindData(); } else if (!result) { this.clearData(); } this.clearSavedPosition(); return result; }
@Override public void close() { super.close(); if (closed.compareAndSet(false, true)) { dbCreator.reduceDatabaseConnection(); } } }
/** */ @Override public boolean moveToPrevious() { this.savePosition(); boolean result = super.moveToPrevious(); if (result && hasPositionChanged()) { result = bindData(); } else if (!result) { this.clearData(); } this.clearSavedPosition(); return result; }
/** */ @Override public boolean moveToFirst() { this.savePosition(); boolean result = super.moveToFirst(); if (result && hasPositionChanged()) { result = bindData(); } else if (!result) { this.clearData(); } this.clearSavedPosition(); return result; }
/** */ @Override public boolean moveToLast() { this.savePosition(); boolean result = super.moveToLast(); if (result && hasPositionChanged()) { result = bindData(); } else if (!result) { this.clearData(); } this.clearSavedPosition(); return result; }
/** */ @Override public boolean move(int offset) { this.savePosition(); boolean result = super.move(offset); if (result && hasPositionChanged()) { result = bindData(); } else if (!result) { this.clearData(); } this.clearSavedPosition(); return result; }
@Override public int getColumnIndex(String columnName) { for (int i = 0, len = mColumnNames.length; i < len; i++) { if (mColumnNames[i].equals(columnName)) { return i; } } return super.getColumnIndex(columnName); }
/** */ @Override public boolean moveToPosition(int position) { this.savePosition(); boolean result = super.moveToPosition(position); if (result && hasPositionChanged()) { result = bindData(); } else if (!result) { this.clearData(); } this.clearSavedPosition(); return result; }
@Override public boolean moveToNext() { boolean result = super.moveToNext(); if (result) { // Load common properties. itemType = getInt(itemTypeIndex); container = getInt(containerIndex); id = getLong(idIndex); serialNumber = getInt(profileIdIndex); user = allUsers.get(serialNumber); restoreFlag = getInt(restoredIndex); } return result; }
@Test @Config(manifest = Config.NONE, shadows = ShadowCursorWrapper1.class) public void getType1() { assertThat(new CursorWrapper(null).getType(expectedType)).isEqualTo(1); }