SqlNote.java

qijingxi
pbhqa7wr4 7 months ago
parent efc52c1cd7
commit 1cc22d810c

@ -37,7 +37,9 @@ import org.json.JSONObject;
import java.util.ArrayList;
/**
* SqlNote
*/
public class SqlNote {
private static final String TAG = SqlNote.class.getSimpleName();
@ -121,7 +123,10 @@ public class SqlNote {
private ContentValues mDiffNoteValues;
private ArrayList<SqlData> mDataList;
/**
* SqlNote
* @param context
*/
public SqlNote(Context context) {
mContext = context;
mContentResolver = context.getContentResolver();
@ -142,7 +147,11 @@ public class SqlNote {
mDiffNoteValues = new ContentValues();
mDataList = new ArrayList<SqlData>();
}
/**
* SqlNote
* @param context
* @param c
*/
public SqlNote(Context context, Cursor c) {
mContext = context;
mContentResolver = context.getContentResolver();
@ -153,7 +162,11 @@ public class SqlNote {
loadDataContent();
mDiffNoteValues = new ContentValues();
}
/**
* IDSqlNote
* @param context
* @param id ID
*/
public SqlNote(Context context, long id) {
mContext = context;
mContentResolver = context.getContentResolver();
@ -225,7 +238,11 @@ public class SqlNote {
c.close();
}
}
/**
* JSON
* @param js JSON
* @return truefalse
*/
public boolean setContent(JSONObject js) {
try {
JSONObject note = js.getJSONObject(GTaskStringUtils.META_HEAD_NOTE);
@ -358,7 +375,10 @@ public class SqlNote {
}
return true;
}
/**
* JSON
* @return JSON
*/
public JSONObject getContent() {
try {
JSONObject js = new JSONObject();
@ -439,7 +459,10 @@ public class SqlNote {
public boolean isNoteType() {
return mType == Notes.TYPE_NOTE;
}
/**
*
* @param validateVersion
*/
public void commit(boolean validateVersion) {
if (mIsCreate) {
if (mId == INVALID_ID && mDiffNoteValues.containsKey(NoteColumns.ID)) {

Loading…
Cancel
Save