Android Open Source - thesearchbattle Base Search Engine






From Project

Back to project page thesearchbattle.

License

The source code is released under:

Apache License

If you think the Android project thesearchbattle listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.raycoarana.thesearchbattle.search;
//from  w w  w  .  j a va  2s  .c  om
import android.util.Log;

import com.raycoarana.thesearchbattle.io.ResultsRegister;
import com.raycoarana.thesearchbattle.model.Car;
import com.raycoarana.thesearchbattle.model.Timer;

import java.util.List;

public abstract class BaseSearchEngine implements SearchEngine {

    private ResultsRegister mResultsRegister;

    protected void setResultsRegister(ResultsRegister resultsRegister) {
        mResultsRegister = resultsRegister;
    }

    @Override
    public List<Car> search(String term) {
        Timer timer = Timer.start();
        List<Car> results = this.onSearch(term);
        timer.stop();
        Log.i(getClass().getSimpleName(), timer.toString());
        mResultsRegister.addResult(timer.toLong());
        return results;
    }

    protected abstract List<Car> onSearch(String term);

}




Java Source Code List

com.raycoarana.thesearchbattle.ApplicationTest.java
com.raycoarana.thesearchbattle.BattleArenaActivity.java
com.raycoarana.thesearchbattle.database.Database.java
com.raycoarana.thesearchbattle.io.ResultsRegister.java
com.raycoarana.thesearchbattle.io.StreamExtensions.java
com.raycoarana.thesearchbattle.model.Car.java
com.raycoarana.thesearchbattle.model.DataSetDefinition.java
com.raycoarana.thesearchbattle.model.Timer.java
com.raycoarana.thesearchbattle.search.BaseSearchEngine.java
com.raycoarana.thesearchbattle.search.FTSSearch.java
com.raycoarana.thesearchbattle.search.MemorySearch.java
com.raycoarana.thesearchbattle.search.SearchEngine.java