qijingxi
pbhqa7wr4 7 months ago
parent 1cc22d810c
commit 2a75f562e9

@ -31,6 +31,9 @@ import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/**
* TaskNode
*/
public class Task extends Node {
private static final String TAG = Task.class.getSimpleName();
@ -44,7 +47,9 @@ public class Task extends Node {
private Task mPriorSibling;
private TaskList mParent;
/**
* Task
*/
public Task() {
super();
mCompleted = false;
@ -53,7 +58,9 @@ public class Task extends Node {
mParent = null;
mMetaInfo = null;
}
/**
* JSON
*/
public JSONObject getCreateAction(int actionId) {
JSONObject js = new JSONObject();
@ -102,7 +109,9 @@ public class Task extends Node {
return js;
}
/**
* JSON
*/
public JSONObject getUpdateAction(int actionId) {
JSONObject js = new JSONObject();
@ -134,7 +143,9 @@ public class Task extends Node {
return js;
}
/**
* JSON
*/
public void setContentByRemoteJSON(JSONObject js) {
if (js != null) {
try {
@ -175,6 +186,9 @@ public class Task extends Node {
}
}
/**
* JSON
*/
public void setContentByLocalJSON(JSONObject js) {
if (js == null || !js.has(GTaskStringUtils.META_HEAD_NOTE)
|| !js.has(GTaskStringUtils.META_HEAD_DATA)) {
@ -203,7 +217,9 @@ public class Task extends Node {
e.printStackTrace();
}
}
/**
* JSON
*/
public JSONObject getLocalJSONFromContent() {
String name = getName();
try {
@ -246,7 +262,9 @@ public class Task extends Node {
return null;
}
}
/**
*
*/
public void setMetaInfo(MetaData metaData) {
if (metaData != null && metaData.getNotes() != null) {
try {
@ -257,7 +275,9 @@ public class Task extends Node {
}
}
}
/**
*
*/
public int getSyncAction(Cursor c) {
try {
JSONObject noteInfo = null;
@ -311,6 +331,9 @@ public class Task extends Node {
return SYNC_ACTION_ERROR;
}
/**
*
*/
public boolean isWorthSaving() {
return mMetaInfo != null || (getName() != null && getName().trim().length() > 0)
|| (getNotes() != null && getNotes().trim().length() > 0);

Loading…
Cancel
Save