You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2Q1/Node.java

102 lines
5.3 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*
* Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.micode.notes.gtask.data;//“包名net.micode.notes.gtask.data”。
import android.database.Cursor;//“导入安卓数据库游标类;”。
import org.json.JSONObject;//“导入 JSON 对象类;”。
public abstract class Node {//“公共抽象类 Node”。
public static final int SYNC_ACTION_NONE = 0;//“公共静态最终整型常量 SYNC_ACTION_NONE同步动作无赋值为 0”。
public static final int SYNC_ACTION_ADD_REMOTE = 1;//“公共静态最终整型常量 SYNC_ACTION_ADD_REMOTE远程添加动作赋值为 1”。
public static final int SYNC_ACTION_ADD_LOCAL = 2;//公共静态最终整型常量 SYNC_ACTION_ADD_LOCAL本地添加动作赋值为 2”。
public static final int SYNC_ACTION_DEL_REMOTE = 3;//“公共静态最终整型常量 SYNC_ACTION_DEL_REMOTE远程删除动作赋值为 3”。
public static final int SYNC_ACTION_DEL_LOCAL = 4;//“公共静态最终整型常量 SYNC_ACTION_DEL_REMOTE远程删除动作赋值为 3”。
public static final int SYNC_ACTION_UPDATE_REMOTE = 5;//“公共静态最终整型常量 SYNC_ACTION_UPDATE_REMOTE远程更新动作赋值为 5”。
public static final int SYNC_ACTION_UPDATE_LOCAL = 6;//“公共静态最终整型常量 SYNC_ACTION_UPDATE_LOCAL本地更新动作赋值为 6”。
public static final int SYNC_ACTION_UPDATE_CONFLICT = 7;//公共静态最终整型常量 SYNC_ACTION_UPDATE_CONFLICT更新冲突动作赋值为 7”。
public static final int SYNC_ACTION_ERROR = 8;//“公共静态最终整型常量 SYNC_ACTION_ERROR错误动作赋值为 8”。
private String mGid;//“私有字符串变量 mGid”。
private String mName;//“私有字符串变量 mName”。
private long mLastModified;//“私有长整型变量 mLastModified”。
private boolean mDeleted;//“私有长整型变量 mLastModified”。
public Node() {//公共的 Node 类的构造方法。”
mGid = null;//“将成员变量 mGid 赋值为 null。”
mName = "";//将成员变量 mName 赋值为空字符串。”
mLastModified = 0;//将成员变量 mLastModified 赋值为 0。”
mDeleted = false;//将成员变量 mDeleted 赋值为 false。”
}
public abstract JSONObject getCreateAction(int actionId);//“公共的抽象方法 getCreateAction接收一个整数参数 actionId返回一个 JSON 对象。”
public abstract JSONObject getUpdateAction(int actionId);//“公共的抽象方法 getUpdateAction接收一个整数参数 actionId返回一个 JSON 对象。”
public abstract void setContentByRemoteJSON(JSONObject js);//“公共的抽象方法 setContentByRemoteJSON接收一个 JSON 对象参数 js。”
public abstract void setContentByLocalJSON(JSONObject js);//“公共的抽象方法 setContentByRemoteJSON接收一个 JSON 对象参数 js。”
public abstract JSONObject getLocalJSONFromContent();//“公共的抽象方法 getLocalJSONFromContent返回一个 JSON 对象。”
public abstract int getSyncAction(Cursor c);//“公共的抽象方法 getSyncAction接收一个 Cursor 参数 c返回一个整数。”
public void setGid(String gid) {//“公共方法 setGid接收一个字符串参数 gid。”
this.mGid = gid;//“将成员变量 mGid 赋值为传入的 gid。”
}
public void setName(String name) {//公共方法 setName接收一个字符串参数 name。”
this.mName = name;//“将成员变量 mName 赋值为传入的 name。”
}
public void setLastModified(long lastModified) {//公共方法 setLastModified接收一个长整型参数 lastModified。”
this.mLastModified = lastModified;//将成员变量 mLastModified 赋值为传入的 lastModified。”
}
public void setDeleted(boolean deleted) {//“公共方法 setDeleted接收一个布尔型参数 deleted。”
this.mDeleted = deleted;//“将成员变量 mDeleted 赋值为传入的 deleted。”
}
public String getGid() {//“公共方法 getGid返回一个字符串。”
return this.mGid;//返回成员变量 mGid。”
}
public String getName() {//“公共方法 getName返回一个字符串。”
return this.mName;//“返回成员变量 mName。”
}
public long getLastModified() {//“公共方法 getLastModified返回一个长整型。”
return this.mLastModified;//“返回成员变量 mLastModified。”
}
public boolean getDeleted() {//公共方法 getDeleted返回一个布尔型。”
return this.mDeleted;//“返回成员变量 mDeleted。”
}
}