matchedpk.java

来自「21天精通Java,这是一本英文书」· Java 代码 · 共 51 行

JAVA
51
字号
package data;

import java.io.*;
import javax.ejb.*;

public class MatchedPK implements Serializable
{
	public String applicant;
	public String job;
	public String customer;

	public MatchedPK() {
	}

	public MatchedPK(String applicant, String job, String customer) {
		this.applicant = applicant;
		this.job = job;
		this.customer = customer;
	}

	public String getJob() {
		return job;
	}

	public String getCustomer() {
		return customer;
	}

	public String getApplicant() {
		return applicant;
	}

	public boolean equals(Object obj) {
		if (obj instanceof MatchedPK) {
			MatchedPK pk = (MatchedPK)obj;
			return (job.equals(pk.job) &&
					customer.equals(pk.customer) &&
					applicant.equals(pk.applicant)) ;
		}
		return false ;
	}

	public int hashCode() {
		return (job.hashCode() ^ customer.hashCode() ^ applicant.hashCode());
	}

	public String toString() {
		return "MatchedPK: applicant="+applicant+", job=" + job + ", customer=" + customer;
	}
}

⌨️ 快捷键说明

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