FileDocCategorySizeDatePackage
SomeDataClass.javaAPI DocExample1854Sun Dec 14 22:47:36 GMT 2003oreilly.hcj.references

SomeDataClass

public class SomeDataClass extends Object
A demo data class with property change listeners.
author
Robert Simmons jr. (kraythe)
version
$Revision: 1.3 $

Fields Summary
protected PropertyChangeSupport
propertyChangeSupport
Utility field used by bound properties.
private int
age
A demo property
Constructors Summary
Methods Summary
public voidaddPropertyChangeListener(java.beans.PropertyChangeListener lst)
Add a property change listener.

param
lst The listener to add.

		propertyChangeSupport.addPropertyChangeListener(lst);
	
public intgetAge()
Getter for property age.

return
The current value of the property age.

		return this.age;
	
public voidremovePropertyChangeListener(java.beans.PropertyChangeListener lst)
Remove a property change listener.

param
lst The listener to add.

		propertyChangeSupport.removePropertyChangeListener(lst);
	
public voidsetAge(int value)
Setter for property value.

param
value The new age.


	          	 
	     
		final int oldAge = this.age;
		this.age = value;
		this.propertyChangeSupport.firePropertyChange("value", oldAge, this.age);