Code example for List

Methods: add, clear

0
        if (result.didPass()) {
            result.clearResults();
            if (mFileFilter.isFail(relativePath)) {
                mUnexpectedPasses.add(result);
            } else { 
                mExpectedPasses.add(result);
            } 
        } else { 
            if (mFileFilter.isFail(relativePath)) {
                mExpectedFailures.add(result);
            } else { 
                mUnexpectedFailures.add(result);
            } 
        } 
 
        if (++mResultsSinceLastDbAccess == RESULTS_PER_DB_ACCESS) {
            persistLists(); 
            clearLists(); 
        } 
    } 
 
    private void clearLists() { 
        mUnexpectedFailures.clear();
        mExpectedFailures.clear();
        mUnexpectedPasses.clear();
        mExpectedPasses.clear();
    } 
 
    private void persistLists() { 
        persistListToTable(mUnexpectedFailures, SummarizerDBHelper.UNEXPECTED_FAILURES_TABLE);
        persistListToTable(mExpectedFailures, SummarizerDBHelper.EXPECTED_FAILURES_TABLE);