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

📄 processcontrolidentifier.java

📁 一个用java写的地震分析软件(无源码)-used to write a seismic analysis software (without source)
💻 JAVA
字号:

package org.trinet.pcs;
public class ProcessControlIdentifier implements Cloneable, Comparable {
    protected Integer hashCodeValue;
    protected String groupName;
    protected String threadName;
    protected String stateName;

    public ProcessControlIdentifier () {}

    public ProcessControlIdentifier (String groupName, String threadName, String stateName) {
        setProcessControlNames(groupName, threadName, stateName);
    }
    public void setProcessControlNames(String groupName, String threadName, String stateName) {
        this.groupName = groupName;
        this.threadName = threadName;
        this.stateName = stateName;
        hashCodeValue = null;
    }

    public String getGroupName() {
        return groupName;
    }
    public void setGroupName(String groupName) {
        this.groupName = groupName;
        hashCodeValue = null;
    }

    public String getThreadName() {
        return threadName;
    }
    public void setThreadName(String threadName) {
        this.threadName = threadName;
        hashCodeValue = null;
    }

    public String getStateName() {
        return stateName;
    }
    public void setStateName(String stateName) {
        this.stateName = stateName;
        hashCodeValue = null;
    }

    public Object clone() {
       ProcessControlIdentifier pcId = null;
       try {
           pcId = (ProcessControlIdentifier) super.clone(); 
       }
       catch (CloneNotSupportedException ex) {
          ex.printStackTrace();
       }
       return pcId;
    }
    public int hashCode() {
       if (hashCodeValue == null) calcHashCode();
       return hashCodeValue.intValue();
    }
    protected void calcHashCode() {
        hashCodeValue = new Integer((groupName + threadName + stateName).hashCode());
    }
    public int compareTo(Object object) {
        ProcessControlIdentifier pcId = (ProcessControlIdentifier) object; 
        return toString().compareTo(pcId.toString());
    }
    public boolean equals(Object object) {
        if (object == this ) return true;
        if (object == null || (object.getClass() != this.getClass()) ) return false;
        ProcessControlIdentifier pcId = (ProcessControlIdentifier) object;
        return toString().equals(pcId.toString());
    }
    public String toString () {
        return groupName + "." + threadName + "." + stateName;
    }
}

⌨️ 快捷键说明

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