contact.java

来自「对于可视的桌面开发系统的一些详细的设计资料」· Java 代码 · 共 76 行

JAVA
76
字号
package gr.osmosis.rcpsamples.pojoeditor;

/*
 * A simple POJO (Contact)
 */
public class Contact {
	private String fname = "";
	private String lname = "";
	private String phone = "";
	private String address = "";
	private String city = "";
	private String zip = "";
		
	public Contact(){
		
	}
	
	public Contact(String fname, String lname, String phone){
		this.fname = fname;
		this.lname = lname;
		this.phone = phone;
	}	
	
	public Contact(boolean dummyInitialization){
		if(dummyInitialization){
			this.fname = "enter your first name ...";
			this.lname = "enter your last name ...";
			this.phone = "enter a phone number ...";
			this.address = "enter an address ...";
			this.city = "enter a city ...";
			this.zip = "enter a ZIP code ...";
		}
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public String getFname() {
		return fname;
	}
	public void setFname(String fname) {
		this.fname = fname;
	}
	public String getLname() {
		return lname;
	}
	public void setLname(String lname) {
		this.lname = lname;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getZip() {
		return zip;
	}
	public void setZip(String zip) {
		this.zip = zip;
	}

	public String toString() {
		return this.lname + " " + this.fname;
	}
			
}

⌨️ 快捷键说明

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