FileDocCategorySizeDatePackage
FriendBean.javaAPI DocExample2352Sun Dec 14 22:47:32 GMT 2003oreilly.hcj.review

FriendBean

public class FriendBean extends oreilly.hcj.datamodeling.MutableObject
A demondstartion of a bean that uses friend access.
author
Robert Simmons jr. (kraythe)
version
$Revision: 1.5 $

Fields Summary
private int
value
A value property.
Constructors Summary
public FriendBean()
Creates a new FriendBean object.

		super();
	
Methods Summary
public booleanequals(java.lang.Object obj)

see
java.lang.Object#equals(java.lang.Object)

		if (!(obj instanceof FriendBean)) {
			return false;
		} else {
			return (((FriendBean)obj).getValue() == this.value);
		}
	
public intgetValue()
Getter for the property value.

return
The current value of the property value.

		return value;
	
public inthashCode()

see
java.lang.Object#hashCode()

		return new Integer(this.value).hashCode();
	
public voidsetValue(int value)
Setter for the property value.

param
value The new value for the prooperty.
throws
IllegalArgumentException If the value is greater than 10.

		if (value > 10) {
			throw new IllegalArgumentException();
		}
		int oldValue = this.value;
		this.value = value;
		propertyChangeSupport.firePropertyChange("value", oldValue, value);
	
public voidsomeBetterMethod()
A utility method someone might call.

		if (Calendar.getInstance()
		            .get(Calendar.DAY_OF_WEEK) == Calendar.THURSDAY) {
			this.setValue(25);
		}
	
public voidsomeMethod()
A utility method someone might call.

		if (Calendar.getInstance()
		            .get(Calendar.DAY_OF_WEEK) == Calendar.THURSDAY) {
			this.value = 25;
		}