1 package org.jboss.cache.data; 2 3 6 public class Address implements java.io.Serializable { 7 protected String city; 8 protected int zip; 9 protected String street; 10 11 public void setCity(String city) 12 { 13 this.city = city; 14 } 15 16 public String getCity() 17 { 18 return this.city; 19 } 20 21 public void setZip(int zip) 22 { 23 this.zip = zip; 24 } 25 26 public int getZip() 27 { 28 return zip; 29 } 30 31 public void setStreet(String street) 32 { 33 this.street = street; 34 } 35 36 public String getStreet() 37 { 38 return this.street; 39 } 40 41 public String getSimpleAddress() 42 { 43 StringBuffer buf = new StringBuffer (street); 44 buf.append(" " + city); 45 if (zip > 0) 46 buf.append(" " + zip); 47 48 return buf.toString(); 49 } 50 51 public String toString() 52 { 53 StringBuffer buf = new StringBuffer (); 54 buf.append("{City = " +city).append(" ,zip = " +zip).append(" ,street = " +street + "}\n"); 55 56 return buf.toString(); 57 } 58 } 59 | Popular Tags |