⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 trxnobj.java

📁 分布式数据库原形代码 可以支持个用户同时登陆到数据库中查询需要的资源
💻 JAVA
字号:
package lockmgr;public class TrxnObj extends XObj{    public static final int READ = 0;    public static final int WRITE = 1;        protected String strData = null;    protected int lockType = -1;    // The data members inherited are     // XObj::protected int xid = 0;        TrxnObj() {        super();        this.strData = null;        this.lockType = -1;    }        TrxnObj(int xid, String strData, int lockType) {        super(xid);        this.strData = new String(strData);        if ((lockType == TrxnObj.READ) || (lockType == TrxnObj.WRITE)) {            this.lockType = lockType;        } else {            this.lockType = -1;    // invalid lock type.        }    }    public String toString() {        String outString = new String(super.toString() + "::strData(" + this.strData + ")::lockType(" + this.lockType + ")");        return outString;    }        public boolean equals(Object t) {        if (t == null) {             return false;        }                if (t instanceof TrxnObj) {            if (this.xid == ((TrxnObj)t).getXId()) {                if (this.strData.equals(((TrxnObj)t).getDataName())) {                    if (this.lockType == ((TrxnObj)t).getLockType()) {                        return true;                    }                }            }        }        return false;    }    public Object clone() {        TrxnObj t = new TrxnObj(this.xid, this.strData, this.lockType);        return t;            }        public void setDataName(String strData) {        this.strData = new String(strData);    }        public String getDataName() {        String strData = new String(this.strData);        return strData;    }        public void setLockType(int lockType) {        if ((lockType == TrxnObj.READ) || (lockType == TrxnObj.WRITE)) {            this.lockType = lockType;        }    }        public int getLockType() {        return this.lockType;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -