Java Reference
In-Depth Information
/** Returns this attribute's name. */
public String getName() {
return name;
}
/** Returns this attribute's value. */
public Object getValue() {
return value;
}
/**
* Sets the value of this attribute. Changes the
* value returned by calls to {@link #getValue}.
* @param newValue The new value for the attribute.
* @return The original value.
* @see #getValue()
*/
public Object setValue(Object newValue) {
Object oldVal = value;
value = newValue;
return oldVal;
}
/**
* Returns a string of the form <code>name=value</code>.
*/
public String toString() {
return name + "='" + value + "'";
}
}
For simple methods like getName , whose whole description is what it re-
turns, the @return tag is often omitted as overkill. Similarly, the con-
structors do not use @param tags because the description is sufficiently
complete. Different organizations will make different choices of when to
use each tag.
 
Search WWH ::




Custom Search