package ComplexMappingTest;
import ComplexMappingTest.Postcode;
import DisplayProject.binding.beans.ExtendedPropertyChangeSupport;
import DisplayProject.binding.beans.Observable;
import Framework.DateTimeNullable;
import Framework.RuntimeProperties;
import Framework.TextData;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.lang.String;
import java.util.Random;
/**
* Address<p>
* <p>
* @author Generated from Forte
* @since 19-Nov-2008
*/
@RuntimeProperties(isDistributed=false, isAnchored=false, isShared=false, isTransactional=false)
@SuppressWarnings("serial")
public class Address
implements Serializable, Observable
{
// ----------
// Attributes
// ----------
public PropertyChangeSupport qq_Listeners = new ExtendedPropertyChangeSupport(this, true);
private DateTimeNullable dateBuilt;
private String line1;
private String line2;
private String line3;
private int propertyType;
private Postcode r_Postcode;
// ------------
// Constructors
// ------------
public Address() {
// Explicitly call the superclass constructor to prevent the implicit call
super();
this.setDateBuilt(new DateTimeNullable(true, DateTimeNullable.qq_Resolver.cISNULL));
this.setR_Postcode(new Postcode());
}
// ----------------------
// Accessors and Mutators
// ----------------------
public void setDateBuilt(DateTimeNullable dateBuilt) {
DateTimeNullable oldValue = this.dateBuilt;
this.dateBuilt = dateBuilt;
this.qq_Listeners.firePropertyChange("dateBuilt", oldValue, this.dateBuilt);
}
public DateTimeNullable getDateBuilt() {
return this.dateBuilt;
}
public void setLine1(String line1) {
String oldValue = this.line1;
this.line1 = line1;
this.qq_Listeners.firePropertyChange("line1", oldValue, this.line1);
}
public String getLine1() {
return this.line1;
}
public void setLine2(String line2) {
String oldValue = this.line2;
this.line2 = line2;
this.qq_Listeners.firePropertyChange("line2", oldValue, this.line2);
}
public String getLine2() {
return this.line2;
}
public void setLine3(String line3) {
String oldValue = this.line3;
this.line3 = line3;
this.qq_Listeners.firePropertyChange("line3", oldValue, this.line3);
}
public String getLine3() {
return this.line3;
}
public void setPropertyType(int propertyType) {
int oldValue = this.propertyType;
this.propertyType = propertyType;
this.qq_Listeners.firePropertyChange("propertyType", oldValue, this.propertyType);
}
public int getPropertyType() {
return this.propertyType;
}
public void setR_Postcode(Postcode r_Postcode) {
Postcode oldValue = this.r_Postcode;
this.r_Postcode = r_Postcode;
this.qq_Listeners.firePropertyChange("r_Postcode", oldValue, this.r_Postcode);
}
public Postcode getR_Postcode() {
return this.r_Postcode;
}
// -------
// Methods
// -------
public void addPropertyChangeListener(String property, PropertyChangeListener listener) {
qq_Listeners.addPropertyChangeListener(property, listener);
}
public void addPropertyChangeListener(PropertyChangeListener listener) {
qq_Listeners.addPropertyChangeListener(listener);
}
public void removePropertyChangeListener(String property, PropertyChangeListener listener) {
qq_Listeners.removePropertyChangeListener(property, listener);
}
public void removePropertyChangeListener(PropertyChangeListener listener) {
qq_Listeners.removePropertyChangeListener(listener);
}
/**
* create<p>
* <p>
* @return Address
*/
public Address create() {
Random x = new Random();
switch (x.nextInt(65536) % 15) {
case 0: {
this.setLine1("12 Smith Street");
break;
}
case 1: {
this.setLine1("14 Ethel Road");
break;
}
case 2: {
this.setLine1("9 Dragon Close");
break;
}
case 3: {
this.setLine1("17 Harbour View Road");
break;
}
case 4: {
this.setLine1("16 Drow Close");
break;
}
case 5: {
this.setLine1("9 Smith Street");
break;
}
case 6: {
this.setLine1("Unit 12");
this.setLine2("18 Upper West Street");
break;
}
case 7: {
this.setLine1("Unit 17");
this.setLine2("998 Lower East Street");
break;
}
case 8: {
this.setLine1("Unit 4");
this.setLine2("8 Far North Street");
break;
}
case 9: {
this.setLine1("Unit 21");
this.setLine2("12 Far South Street");
break;
}
case 10: {
this.setLine1("Unit 9");
this.setLine2("108 Upper West Street");
break;
}
case 11: {
this.setLine1("The Magnolias");
this.setLine2("Treasury Estate");
this.setLine3("99 West Park");
break;
}
case 12: {
this.setLine1("The Daisys");
this.setLine2("Money Estate");
this.setLine3("209 West Park");
break;
}
case 13: {
this.setLine1("The Reaches");
this.setLine2("Great Estate");
this.setLine3("203 Northington Road");
break;
}
case 14: {
this.setLine1("The Hardburys");
this.setLine2("Lower Estate");
this.setLine3("12 Chipping Road");
break;
}
}
if (x.nextInt(65536) % 2 == 0) {
this.setPropertyType(1);
}
else {
this.setPropertyType(2);
}
if (x.nextInt(65536) % 2 == 0) {
this.getDateBuilt().setIsNull(true);
}
else {
// self.DateBuilt.IsNull = false;
TextData aDate = new TextData();
aDate.concat(10+(x.nextInt(65536) % 15));
switch (x.nextInt(65536) % 4) {
case 0: {
aDate.concat("-Jan-");
break;
}
case 1: {
aDate.concat("-Aug-");
break;
}
case 2: {
aDate.concat("-Jun-");
break;
}
case 3: {
aDate.concat("-Dec-");
break;
}
}
aDate.concat(1900+(x.nextInt(65536) % 100)).concat(" 00:00:00");
this.getDateBuilt().setValue(aDate);
}
this.setR_Postcode(new Postcode().create());
return this;
}
/**
* toString<p>
* <p>
* @return String
*/
public String toString() {
TextData aMsg = new TextData();
aMsg.concat(this.getLine1());
if (!("".equals(this.getLine2())) && this.getLine2() != null) {
aMsg.concat(" ").concat(this.getLine2());
}
if (!("".equals(this.getLine3())) && this.getLine3() != null) {
aMsg.concat(" ").concat(this.getLine3());
}
aMsg.concat(" [");
if (this.getPropertyType() == 1) {
aMsg.concat("Residential");
}
else {
aMsg.concat("Commercial");
}
aMsg.concat("]");
aMsg.concat(" -").concat(this.getDateBuilt()).concat("-");
if (this.getR_Postcode() != null) {
aMsg.concat(" {").concat(this.getR_Postcode().toString()).concat("}");
}
return aMsg.getValue();
}
} // end class Address
// c Pass 2 Conversion Time: 437 milliseconds