Android Open Source - thesearchbattle Car






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.model;
/*w  w  w. j ava2  s  .  co m*/
import android.database.Cursor;

import java.util.ArrayList;
import java.util.List;

public class Car {

    private long mId;
    private String mCountry;
    private String mBrand;
    private String mName;
    private int mYear;

    public static List<Car> fromCursor(Cursor cursor) {
        ArrayList<Car> cars = new ArrayList<Car>();

        int idColumnIndex = cursor.getColumnIndex("_id");
        int countryColumnIndex = cursor.getColumnIndex("country");
        int brandColumnIndex = cursor.getColumnIndex("brand");
        int nameColumnIndex = cursor.getColumnIndex("name");
        int yearColumnIndex = cursor.getColumnIndex("year");

        while(cursor.moveToNext()) {
            Car car = new Car();
            car.setId(cursor.getLong(idColumnIndex));
            car.setCountry(cursor.getString(countryColumnIndex));
            car.setBrand(cursor.getString(brandColumnIndex));
            car.setName(cursor.getString(nameColumnIndex));
            car.setYear(cursor.getInt(yearColumnIndex));
            cars.add(car);
        }

        return cars;
    }

    public long getId() {
        return mId;
    }

    public void setId(long id) {
        this.mId = id;
    }

    public String getCountry() {
        return mCountry;
    }

    public void setCountry(String country) {
        this.mCountry = country;
    }

    public String getBrand() {
        return mBrand;
    }

    public void setBrand(String brand) {
        this.mBrand = brand;
    }

    public String getName() {
        return mName;
    }

    public void setName(String name) {
        this.mName = name;
    }

    public int getYear() {
        return mYear;
    }

    public void setYear(int year) {
        this.mYear = year;
    }
}




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