• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

コミットメタ情報

リビジョン9994f71c09930ff975c40792e746197315bcaa88 (tree)
日時2013-01-30 17:00:59
作者Masahiko, SAWAI <say@user...>
コミッターMasahiko, SAWAI

ログメッセージ

Refactoring classes in intent provider package.

変更サマリ

差分

--- a/intent-lab/src/org/routine_work/intent_lab/intent/provider/IntentDBConstants.java
+++ b/intent-lab/src/org/routine_work/intent_lab/intent/provider/IntentDBConstants.java
@@ -23,8 +23,6 @@
2323 */
2424 package org.routine_work.intent_lab.intent.provider;
2525
26-import android.provider.BaseColumns;
27-
2826 /**
2927 *
3028 * @author sawai
@@ -39,41 +37,31 @@ interface IntentDBConstants
3937 {
4038
4139 static final String TABLE_NAME = "Intents";
42- interface Columns extends BaseColumns
43- {
44-
45- String DATA = "_data";
46- String CREATED = "created";
47- String MODIFIED = "modified";
48- String NAME = "name";
49- String ACTION = "action"; // Intent.getAction()
50- String DATA_URI = "data_uri"; // Intent.getData()
51- }
5240 // CREATE SQL
5341 static final String CREATE_TABLE_SQL = "CREATE TABLE " + TABLE_NAME + "("
54- + " " + Columns._ID + " INTEGER PRIMARY KEY AUTOINCREMENT"
55- + ", " + Columns.NAME + " TEXT"
56- + ", " + Columns.DATA + " TEXT"
57- + ", " + Columns.CREATED + " INTEGER NOT NULL"
58- + ", " + Columns.MODIFIED + " INTEGER NOT NULL"
59- + ", " + Columns.ACTION + " TEXT"
60- + ", " + Columns.DATA_URI + " TEXT"
42+ + " " + IntentStore.Intents.Columns._ID + " INTEGER PRIMARY KEY AUTOINCREMENT"
43+ + ", " + IntentStore.Intents.Columns.NAME + " TEXT"
44+ + ", " + IntentStore.Intents.Columns.DATA + " TEXT"
45+ + ", " + IntentStore.Intents.Columns.CREATED + " INTEGER NOT NULL"
46+ + ", " + IntentStore.Intents.Columns.MODIFIED + " INTEGER NOT NULL"
47+ + ", " + IntentStore.Intents.Columns.ACTION + " TEXT"
48+ + ", " + IntentStore.Intents.Columns.DATA_URI + " TEXT"
6149 + ");";
6250 String CREATE_TITLE_INDEX_SQL = "CREATE INDEX "
63- + TABLE_NAME + "_" + Columns.NAME + "_index "
64- + "ON " + TABLE_NAME + "(" + Columns.NAME + ");";
51+ + TABLE_NAME + "_" + IntentStore.Intents.Columns.NAME + "_index "
52+ + "ON " + TABLE_NAME + "(" + IntentStore.Intents.Columns.NAME + ");";
6553 String CREATE_CREATED_INDEX_SQL = "CREATE INDEX "
66- + TABLE_NAME + "_" + Columns.CREATED + "_index "
67- + "ON " + TABLE_NAME + "(" + Columns.CREATED + ");";
54+ + TABLE_NAME + "_" + IntentStore.Intents.Columns.CREATED + "_index "
55+ + "ON " + TABLE_NAME + "(" + IntentStore.Intents.Columns.CREATED + ");";
6856 String CREATE_MODIFIED_INDEX_SQL = "CREATE INDEX "
69- + TABLE_NAME + "_" + Columns.MODIFIED + "_index "
70- + "ON " + TABLE_NAME + "(" + Columns.MODIFIED + ");";
57+ + TABLE_NAME + "_" + IntentStore.Intents.Columns.MODIFIED + "_index "
58+ + "ON " + TABLE_NAME + "(" + IntentStore.Intents.Columns.MODIFIED + ");";
7159 String CREATE_ACTION_INDEX_SQL = "CREATE INDEX "
72- + TABLE_NAME + "_" + Columns.ACTION + "_index "
73- + "ON " + TABLE_NAME + "(" + Columns.ACTION + ");";
60+ + TABLE_NAME + "_" + IntentStore.Intents.Columns.ACTION + "_index "
61+ + "ON " + TABLE_NAME + "(" + IntentStore.Intents.Columns.ACTION + ");";
7462 String CREATE_DATA_URI_INDEX_SQL = "CREATE INDEX "
75- + TABLE_NAME + "_" + Columns.DATA_URI + "_index "
76- + "ON " + TABLE_NAME + "(" + Columns.DATA_URI + ");";
63+ + TABLE_NAME + "_" + IntentStore.Intents.Columns.DATA_URI + "_index "
64+ + "ON " + TABLE_NAME + "(" + IntentStore.Intents.Columns.DATA_URI + ");";
7765 // DROP SQL
7866 static final String DROP_TABLE_SQL = "DROP TABLE " + TABLE_NAME + ";";
7967 }
--- a/intent-lab/src/org/routine_work/intent_lab/intent/provider/IntentProvider.java
+++ b/intent-lab/src/org/routine_work/intent_lab/intent/provider/IntentProvider.java
@@ -108,7 +108,7 @@ public class IntentProvider extends ContentProvider
108108 Uri newUri = ContentUris.withAppendedId(IntentStore.Intents.CONTENT_URI, rowID);
109109
110110 // update data path
111- String data = initialValues.getAsString(Intents.Columns.DATA);
111+ String data = initialValues.getAsString(IntentStore.Intents.Columns.DATA);
112112 Log.d(LOG_TAG, "insert() : data => " + data);
113113 if (data == null)
114114 {
@@ -116,7 +116,7 @@ public class IntentProvider extends ContentProvider
116116 Log.d(LOG_TAG, "insert() : file => " + file);
117117
118118 ContentValues values = new ContentValues();
119- values.put(Intents.Columns.DATA, file.getPath());
119+ values.put(IntentStore.Intents.Columns.DATA, file.getPath());
120120 update(newUri, values, null, null);
121121 }
122122
@@ -139,7 +139,7 @@ public class IntentProvider extends ContentProvider
139139 break;
140140 case INTENTS_ITEM_BY_ID:
141141 String segment = uri.getPathSegments().get(1);
142- StringBuilder whereClause = new StringBuilder(Intents.Columns._ID).append("=").append(segment);
142+ StringBuilder whereClause = new StringBuilder(IntentStore.Intents.Columns._ID).append("=").append(segment);
143143 if (!TextUtils.isEmpty(where))
144144 {
145145 whereClause.append(" AND (").append(where).append(")");
@@ -170,7 +170,7 @@ public class IntentProvider extends ContentProvider
170170
171171 case INTENTS_ITEM_BY_ID:
172172 String segment = uri.getPathSegments().get(1);
173- StringBuilder whereClause = new StringBuilder(Intents.Columns._ID).append("=").append(segment);
173+ StringBuilder whereClause = new StringBuilder(IntentStore.Intents.Columns._ID).append("=").append(segment);
174174 if (!TextUtils.isEmpty(where))
175175 {
176176 whereClause.append(" AND (").append(where).append(")");
--- a/intent-lab/src/org/routine_work/intent_lab/intent/provider/IntentStore.java
+++ b/intent-lab/src/org/routine_work/intent_lab/intent/provider/IntentStore.java
@@ -56,12 +56,12 @@ public class IntentStore
5656 interface Columns extends BaseColumns
5757 {
5858
59- String DATA = IntentDBConstants.Intents.Columns.DATA;
60- String CREATED = IntentDBConstants.Intents.Columns.CREATED;
61- String MODIFIED = IntentDBConstants.Intents.Columns.MODIFIED;
62- String NAME = IntentDBConstants.Intents.Columns.NAME;
63- String ACTION = IntentDBConstants.Intents.Columns.ACTION;
64- String DATA_URI = IntentDBConstants.Intents.Columns.DATA_URI;
59+ String DATA = "_data";
60+ String CREATED = "created";
61+ String MODIFIED = "modified";
62+ String NAME = "name";
63+ String ACTION = "action"; // Intent.getAction()
64+ String DATA_URI = "data_uri"; // Intent.getData()
6565 }
6666 public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/intents");
6767 public static final String INTENT_LIST_CONTENT_TYPE = "vnd.android.cursor.dir/vnd.routine_work.intent";
@@ -125,8 +125,8 @@ public class IntentStore
125125 OutputStream os = cr.openOutputStream(newUri);
126126 try
127127 {
128- byte[] marshalIntent = marshalIntent(intent);
129- os.write(marshalIntent);
128+ byte[] marshalledIntent = marshalIntent(intent);
129+ os.write(marshalledIntent);
130130 }
131131 finally
132132 {