xobj.java
来自「分布式数据库原形代码 可以支持个用户同时登陆到数据库中查询需要的资源」· Java 代码 · 共 68 行
JAVA
68 行
package lockmgr;public class XObj{ protected int xid = 0; XObj() { super(); this.xid = 0; } XObj(int xid) { super(); if (xid > 0) { this.xid = xid; } else { this.xid = 0; } } public String toString() { String outString = new String(this.getClass() + "::xid(" + this.xid + ")"); return outString; } public int getXId() { return this.xid; } public int hashCode() { return this.xid; } public boolean equals(Object xobj) { if (xobj == null) return false; if (xobj instanceof XObj) { if (this.xid == ((XObj)xobj).getXId()) { return true; } } return false; } public Object clone() { try { XObj xobj = (XObj)super.clone(); xobj.SetXId(this.xid); return xobj; } catch (CloneNotSupportedException clonenotsupported) { return null; } } public int key() { return this.xid; } // Used by clone. public void SetXId(int xid) { if (xid > 0) { this.xid = xid; } return; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?