Back to project page ArchPad.
The source code is released under:
GNU General Public License
If you think the Android project ArchPad listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.Andryyo.ArchPad.archeryFragment; //from w w w . j a v a2 s . c o m import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import com.Andryyo.ArchPad.database.CSQLiteOpenHelper; import java.io.IOException; import java.io.Serializable; import java.util.ArrayList; /** * Created with IntelliJ IDEA. * User: ??????? * Date: 24.06.13 * Time: 18:58 * To change this template use File | Settings | File Templates. */ public class CRoundTemplate implements Serializable{ private long arrowId; private String description; //??? ??? ??????? ????????????? ??????? ???????? ???????????? ???????????? ??? ????????????? private ArrayList<CDistanceTemplate> templates = new ArrayList<CDistanceTemplate>(); public CRound createRound(Context context) { return new CRound(context, description, templates, arrowId); } public CRoundTemplate setArrowId(long id) { this.arrowId = id; return this; } public CRoundTemplate addDistanceTemplate(CDistanceTemplate template) { templates.add(template); return this; } public CRoundTemplate setDescription(String description) { this.description = new String(description); return this; } public void writeToDatabase(SQLiteDatabase database) { ContentValues values = new ContentValues(); values.put("description", description); try { values.put("template",CSQLiteOpenHelper.getObjectBytes(this)); } catch (IOException e) { e.printStackTrace(); } database.insert(CSQLiteOpenHelper.TABLE_ROUND_TEMPLATES, null, values); } }