Fields Summary |
---|
private static final long | serialVersionUIDUse serialVersionUID for interoperability. |
private PropertyChangeSupport | propertyChangeSupportProvides support for property change events. |
private Set | purchasesHolds value of property purchases. |
private Set | purchases2Holds value of property purchases2. |
private Set | purchases3Holds value of property purchases3. |
private String | nameName of the customer. |
private VetoableChangeSupport | vetoableChangeSupportUtility field used by constrained properties. |
Methods Summary |
---|
public void | addPropertyChangeListener(java.beans.PropertyChangeListener l)
propertyChangeSupport.addPropertyChangeListener(l);
|
public void | addVetoableChangeListener(java.beans.VetoableChangeListener l)
vetoableChangeSupport.addVetoableChangeListener(l);
|
public java.lang.String | getName()Getter for the property name.
return this.name;
|
public java.util.Set | getPurchases()Getter for property purchases.Note that this doesn't protect the sets as they are
given out to the callers of this method.
return this.purchases;
|
public java.util.Set | getPurchases2()Getter for property purchases2. Note that you will have to check for null in the
return value.
if (this.purchases2 == null) {
return null;
}
return Collections.unmodifiableSet(this.purchases2);
|
public java.util.Set | getPurchases3()Getter for property purchases3.Returns the value of the property. Since the
property can never be null, the user has the ability to use the return value
without checking for null.
return Collections.unmodifiableSet(this.purchases3);
|
public void | removePropertyChangeListener(java.beans.PropertyChangeListener l)
propertyChangeSupport.removePropertyChangeListener(l);
|
public void | removeVetoableChangeListener(java.beans.VetoableChangeListener l)
vetoableChangeSupport.removeVetoableChangeListener(l);
|
public void | setName(java.lang.String name)Setter for the property name.
final String oldName = this.name;
vetoableChangeSupport.fireVetoableChange("name", oldName, this.name);
this.name = name;
propertyChangeSupport.firePropertyChange("name", oldName, this.name);
|
public void | setPurchases(java.util.Set purchases)Setter for property purchases. Note that this doesn't protect the sets as they are
given out to the PropertyChangeListener and PropertyVetoListener objects.
Set oldPurchases = this.purchases;
vetoableChangeSupport.fireVetoableChange("purchases", oldPurchases, this.purchases);
this.purchases = purchases;
propertyChangeSupport.firePropertyChange("purchases", oldPurchases, this.purchases);
|
public void | setPurchases2(java.util.Set purchases2)Setter for property purchases2.This method fully protects the incomming set so
that the vetoable change listener, and the propertyChangeListener cant change it.
final Set newPurchases2;
if (purchases2 != null) {
newPurchases2 = Collections.unmodifiableSet(purchases2);
} else {
newPurchases2 = null;
}
final Set oldpurchases2 = this.getPurchases2();
vetoableChangeSupport.fireVetoableChange("purchases2", oldpurchases2,
newPurchases2);
this.purchases2 = new HashSet(purchases2);
propertyChangeSupport.firePropertyChange("purchases2", oldpurchases2,
getPurchases2());
|
public void | setPurchases3(java.util.Set purchases3)Setter for property purchases3. This method fully protects the incomming set so
that the vetoable change listener, and the propertyChangeListener cant change it.
In addition, since the property can never be null, you dont have to worry about
checking for null.
if (purchases3 == null) {
throw new NullPointerException();
}
final Set oldPurchases3 = this.getPurchases3();
final Set newPurchases3 = Collections.unmodifiableSet(purchases3);
vetoableChangeSupport.fireVetoableChange("purchases3", oldPurchases3,
newPurchases3);
this.purchases3 = new HashSet(purchases3);
propertyChangeSupport.firePropertyChange("purchases3", oldPurchases3,
getPurchases3());
|