From 3b9f7df5facb21365d3c82c85ac8ad528bdd082b Mon Sep 17 00:00:00 2001 From: pf8ifcmps <15206816379@163.com> Date: Wed, 9 Oct 2024 23:12:07 +0800 Subject: [PATCH] Delete 'Node.java' --- Node.java | 198 ------------------------------------------------------ 1 file changed, 198 deletions(-) delete mode 100644 Node.java diff --git a/Node.java b/Node.java deleted file mode 100644 index 6448b71..0000000 --- a/Node.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - * 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. - */ - -java - // 导入所需的包 - - package net.micode.notes.gtask.data; - - - - import android.database.Cursor; // 用于数据库查询结果的游标 - - import org.json.JSONObject; // JSON对象类 - - - - // 定义一个抽象类Node,它代表了一个节点(如任务、笔记等)的基本属性和行为 - - public abstract class Node { - - // 定义同步操作的常量,用于指示节点的同步状态或要执行的同步动作 - - public static final int SYNC_ACTION_NONE = 0; // 无操作 - - public static final int SYNC_ACTION_ADD_REMOTE = 1; // 在远程添加 - - public static final int SYNC_ACTION_ADD_LOCAL = 2; // 在本地添加 - - public static final int SYNC_ACTION_DEL_REMOTE = 3; // 在远程删除 - - public static final int SYNC_ACTION_DEL_LOCAL = 4; // 在本地删除 - - public static final int SYNC_ACTION_UPDATE_REMOTE = 5; // 更新远程节点 - - public static final int SYNC_ACTION_UPDATE_LOCAL = 6; // 更新本地节点 - - public static final int SYNC_ACTION_UPDATE_CONFLICT = 7; // 更新冲突 - - public static final int SYNC_ACTION_ERROR = 8; // 同步错误 - - - - // 定义节点的私有属性 - - private String mGid; // 节点的全局唯一标识符 - - private String mName; // 节点的名称 - - private long mLastModified; // 节点最后修改的时间戳 - - private boolean mDeleted; // 节点是否被删除的标志 - - - - // 构造方法,初始化节点的属性 - - public Node() { - - mGid = null; // GID初始化为null,表示新创建的节点还没有GID - - mName = ""; // 名称初始化为空字符串 - - mLastModified = 0; // 最后修改时间初始化为0,表示节点还没有被修改过 - - mDeleted = false; // 删除标志初始化为false,表示节点没有被删除 - - } - - - - // 抽象方法,用于获取创建节点的动作JSON对象,具体实现由子类提供 - - public abstract JSONObject getCreateAction(int actionId); - - - - // 抽象方法,用于获取更新节点的动作JSON对象,具体实现由子类提供 - - public abstract JSONObject getUpdateAction(int actionId); - - - - // 抽象方法,用于从远程JSON对象设置节点的内容,具体实现由子类提供 - - public abstract void setContentByRemoteJSON(JSONObject js); - - - - // 抽象方法,用于从本地JSON对象设置节点的内容,具体实现由子类提供 - - public abstract void setContentByLocalJSON(JSONObject js); - - - - // 抽象方法,用于将节点的内容转换为本地JSON对象,具体实现由子类提供 - - public abstract JSONObject getLocalJSONFromContent(); - - - - // 抽象方法,用于根据数据库游标获取节点的同步动作,具体实现由子类提供 - - public abstract int getSyncAction(Cursor c); - - - - // 设置节点的GID - - public void setGid(String gid) { - - this.mGid = gid; - - } - - - - // 获取节点的GID - - public String getGid() { - - return this.mGid; - - } - - - - // 设置节点的名称 - - public void setName(String name) { - - this.mName = name; - - } - - - - // 获取节点的名称 - - public String getName() { - - return this.mName; - - } - - - - // 设置节点最后修改的时间戳 - - public void setLastModified(long lastModified) { - - this.mLastModified = lastModified; - - } - - - - // 获取节点最后修改的时间戳 - - public long getLastModified() { - - return this.mLastModified; - - } - - - - // 设置节点是否被删除的标志 - - public void setDeleted(boolean deleted) { - - this.mDeleted = deleted; - - } - - - - // 获取节点是否被删除的标志 - - public boolean getDeleted() { - - return this.mDeleted; - - } - - } \ No newline at end of file