Android Open Source - SeniorDesign Setting






From Project

Back to project page SeniorDesign.

License

The source code is released under:

GNU General Public License

If you think the Android project SeniorDesign 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 fakesetgame.seniordesign.data;
// www  .  ja  v  a  2 s  .co m
import android.database.Cursor;
import android.provider.BaseColumns;

/**
 * A class to hold a game setting value retrieved from the database.
 */
public class Setting {

    private final long _id;
    private final String name;
    private final String value;

    private Setting(long _id, String name, String value) {
        this._id = _id;
        this.name = name;
        this.value = value;
    }

    public long getId() {
        return _id;
    }

    public String getName() {
        return name;
    }

    public String getValue() {
        return value;
    }

    public static Setting fromCursor(Cursor c) {

        return new Setting(
                c.getLong(c.getColumnIndexOrThrow(TableDef._ID)),
                c.getString(c.getColumnIndexOrThrow(TableDef.COLUMN_NAME_NAME)),
                c.getString(c.getColumnIndexOrThrow(TableDef.COLUMN_NAME_VALUE))
        );
    }

    /**
     * Defines the found set table
     */
    public static abstract class TableDef implements BaseColumns {

        public static final String TABLE_NAME = "settings";

        public static final String COLUMN_NAME_NAME = "name";
        public static final String COLUMN_NAME_VALUE = "value";

        public static final String[] ALL_COLUMNS = {
                TableDef._ID,
                TableDef.COLUMN_NAME_NAME,
                TableDef.COLUMN_NAME_VALUE,
        };
    }
}




Java Source Code List

fakesetgame.seniordesign.BoardTest.java
fakesetgame.seniordesign.GameScreen.java
fakesetgame.seniordesign.GameTest.java
fakesetgame.seniordesign.HomeScreen.java
fakesetgame.seniordesign.OptionsScreen.java
fakesetgame.seniordesign.SettingsTest.java
fakesetgame.seniordesign.SplashScreen.java
fakesetgame.seniordesign.SummaryScreen.java
fakesetgame.seniordesign.TileSetTest.java
fakesetgame.seniordesign.data.FoundSetRecord.java
fakesetgame.seniordesign.data.GameOutcome.java
fakesetgame.seniordesign.data.GameSummaryListItemCursorAdapter.java
fakesetgame.seniordesign.data.OptionsHelper.java
fakesetgame.seniordesign.data.PlayerDataDbHelper.java
fakesetgame.seniordesign.data.Setting.java
fakesetgame.seniordesign.data.package-info.java
fakesetgame.seniordesign.model.BoardSize.java
fakesetgame.seniordesign.model.Board.java
fakesetgame.seniordesign.model.Color.java
fakesetgame.seniordesign.model.GameOverEvent.java
fakesetgame.seniordesign.model.GameOverListener.java
fakesetgame.seniordesign.model.Game.java
fakesetgame.seniordesign.model.HintProvider.java
fakesetgame.seniordesign.model.Modifier.java
fakesetgame.seniordesign.model.Shading.java
fakesetgame.seniordesign.model.Shape.java
fakesetgame.seniordesign.model.TileSet.java
fakesetgame.seniordesign.model.Tile.java
fakesetgame.seniordesign.model.package-info.java
fakesetgame.seniordesign.view.GameSummaryListItemView.java
fakesetgame.seniordesign.view.ShadedImageView.java
fakesetgame.seniordesign.view.package-info.java
fakesetgame.seniordesign.package-info.java