Author: ruschein
Date: 2010-08-03 16:09:37 -0700 (Tue, 03 Aug 2010)
New Revision: 21167
Modified:
core3/work-api/trunk/src/main/java/org/cytoscape/work/AbstractHandler.java
core3/work-api/trunk/src/main/java/org/cytoscape/work/Handler.java
Log:
Cleaned up interface documentation.
Modified:
core3/work-api/trunk/src/main/java/org/cytoscape/work/AbstractHandler.java
===================================================================
--- core3/work-api/trunk/src/main/java/org/cytoscape/work/AbstractHandler.java
2010-08-03 23:09:35 UTC (rev 21166)
+++ core3/work-api/trunk/src/main/java/org/cytoscape/work/AbstractHandler.java
2010-08-03 23:09:37 UTC (rev 21167)
@@ -10,7 +10,7 @@
* Abstract handler for tunables. It provides constructor for Fields and
Methods that have been detected by <code>AbstractTunableInterceptor</code>,
* basic methods to access to the handler components, and to manage the
listeners for handler events.
*
- * It is considered as a super class for <code>AbstractGuiHandler</code> and
<code>AbstractPropHandler</code>.
+ * This is a super class for <code>AbstractGuiHandler</code> and
<code>AbstractPropHandler</code>.
*
* @author pasteur
*
@@ -19,12 +19,15 @@
public abstract class AbstractHandler implements Handler {
/**
- * Field that need to be intercepted
+ * Field that needs to be intercepted
+ *
+ * To access to the field use : <code>f.get(o)</code>
*/
protected Field f;
/**
- * Method that need to be intercepted. This getter method(to get the
value of another Object from the class) need to be coupled with the smethod or
setter method(to set the value of this previous Object)
+ * Method that need to be intercepted. This getter method(to get the
value of another Object from the class)
+ * need to be coupled with the smethod or setter method(to set the
value of this previous Object)
* This method will be annotated as a <code>Tunable</code>
*/
protected Method gmethod;
@@ -36,9 +39,7 @@
protected Method smethod;
/**
- * Object that is contained in the Field <code>f</code>
- *
- * To access to the Object <code>o</code>, use : <code>f.get(o)</code>
+ * Object that contains the field <code>f</code> or the setter
<code>smethod</code> and getter <code>gmethod</code>
*/
protected Object o;
@@ -58,10 +59,9 @@
* <code>Tunable</code> annotations of the Method
<code>smethod</code>(setter method) annotated as <code>Tunable</code>
*/
protected Tunable ts;
-
/**
- * Handler for Fields values
+ * Handler for Field values
* @param f field that has been annotated
* @param o object contained in <code>f</code>
* @param t tunable associated to <code>f</code>
@@ -73,27 +73,27 @@
}
/**
- * Handler for 2 Methods : <code>gmethod</code> and <code>smethod</code>
+ * Handler for getter/setter methods <code>gmethod</code> and
<code>smethod</code>.
+ *
* @param getmethod method that has been annotated as a <i>getter</i>
* @param setmethod method that has been annotated as a <i>setter</i>
* @param o object contained in methods
* @param tg tunable associated to <code>gmethod</code>
* @param ts tunable associated to <code>smethod</code>
*/
- public AbstractHandler(Method getmethod, Method setmethod, Object o,
Tunable tg, Tunable ts){
+ public AbstractHandler(Method getmethod, Method setmethod, Object o,
Tunable tg, Tunable ts) {
this.gmethod = getmethod;
this.smethod = setmethod;
this.o = o;
this.tg = tg;
this.ts = ts;
}
-
/**
* To get <code>Field f</code>
* @return field component from the handler
*/
- public Field getField() {
+ final public Field getField() {
return f;
}
@@ -101,7 +101,7 @@
* To get <code>Method gmethod</code>
* @return method component from the handler
*/
- public Method getGetMethod() {
+ final public Method getGetMethod() {
return gmethod;
}
@@ -109,39 +109,35 @@
* To get <code>Method smethod</code>
* @return method component from the handler
*/
- public Method getSetMethod() {
+ final public Method getSetMethod() {
return smethod;
}
-
-
/**
* To get <code>Object o</code>
* @return object component from the handler
*/
- public Object getObject() {
+ final public Object getObject() {
return o;
}
/**
- * To get <code>Tunable tg</code>
- * @return tunable component from the handler
+ * @return tunable component for the getter method
*/
- public Tunable getGetTunable() {
+ final public Tunable getGetTunable() {
return tg;
}
/**
- * To get <code>Tunable ts</code>
- * @return tunable component from the handler
+ * @return tunable component for the setter method
*/
- public Tunable getSetTunable() {
+ final public Tunable getSetTunable() {
return ts;
}
+
/**
- * To get <code>Tunable t</code>
- * @return tunable component from the handler
+ * @return tunable component for a field
*/
public Tunable getTunable() {
return t;
Modified: core3/work-api/trunk/src/main/java/org/cytoscape/work/Handler.java
===================================================================
--- core3/work-api/trunk/src/main/java/org/cytoscape/work/Handler.java
2010-08-03 23:09:35 UTC (rev 21166)
+++ core3/work-api/trunk/src/main/java/org/cytoscape/work/Handler.java
2010-08-03 23:09:37 UTC (rev 21167)
@@ -4,66 +4,64 @@
import java.lang.reflect.Method;
- /**
- * This interface specifies all the methods that will be applied to the
<code>Handler</code>.
- *
- * <p><pre>
- * The <code>Handler</code> can be used for the construction of the GUI
(by using the <code>Guihandler</code>),
- * or can also be used to get parameters from the command line (by
using the <code>CLHandler</code>),
- * or even to get the properties for each <code>Tunable</code> object
through its <code>Handlers</code>.
- *
- * <code>Handler</code> will also be used to set the values that are in
the <code>Handler</code> to the Properties object with <code>PropHandler</code>
- *
- * Access to different parts of the <code>Handler</code> is allowed by
using the <code>getField()</code>,
- * <code>getObject()</code>, and <code>getTunable</code> methods.
- * </pre></p>
- * @author pasteur
- */
+/**
+ * This interface specifies all the methods that will be applied to a
<code>Handler</code>.
+ *
+ * <p><pre>
+ * The <code>Handler</code> can be used for the construction of the GUI (by
using the <code>Guihandler</code>),
+ * or can also be used to get parameters from the command line (by using the
<code>CLHandler</code>),
+ * and also to get the properties for each <code>Tunable</code> object through
its <code>Handlers</code>.
+ *
+ * <code>Handler</code> will also be used to set the values that are in the
<code>Handler</code> to the Properties object with <code>PropHandler</code>
+ *
+ * Access to different parts of the <code>Handler</code> is allowed by using
the <code>getField()</code>,
+ * <code>getObject()</code>, and <code>getTunable</code> methods.
+ * </pre></p>
+ * @author pasteur
+ */
-// The <code>Handler</code> may also be modified. Thus, need to add some
listeners to catch the modifications.
-// Possibility to change the handler by setting it a new one.
-
+/** Tunables can be accessed through either {getField(),getTunable()} or
{getGetMethod(),getSetMethod(),getGetTunable(),getSetTunable()}.
+ * Those two sets of methods are mutually exclusive, either one set will
return all nulls or the other set will. The direct field access (corresponding
+ * to the first set is easier to use but, both, less flexible and violates
information-hiding best practices.
+ */
public interface Handler {
/**
- *
- * @return the field or null if no field has been associated with this
handler
+ * @return an object describing a field annotated with @Tunable or null
if no field has been associated with this handler
*/
Field getField();
/**
- * To get the Handler's object. In order to actually set a field, both
an instance of Field as well as an object instance are required.
- * @return object
+ * In order to actually set a field, both an instance of Field as well
as an object instance are required. Similarly, in order to call setter and
getter
+ * methods an object instance is required.
+ *
+ * @return if getField() returns non-null, this will return an instance
whose annotated field can be accessed with the Field instance returned by
getField
+ * otherwise the returned object will be the one with annoated
getter send setter methods
*/
Object getObject();
/**
- * To get the Handler's Tunable
- * @return the tunable managed by this handler
+ * @return the tunable that is annotating the field represented by the
Field instance returned by getField()
*/
Tunable getTunable();
-
/**
- * To get the handler's GetMethod
- * @return Method
+ * @return an instance of Method representating a getter method
annotated with @Tunable or null
*/
Method getGetMethod();
+
/**
- * To get the handler's SetMethod
- * @return Method
+ * @return an instance of Method representating a setter method
annotated with @Tunable or null
*/
Method getSetMethod();
/**
- * To get the Handler's GetTunable
- * @return Tunable
+ * @return the Tunable associated with a getter method
*/
Tunable getGetTunable();
/**
- * To get the Handler's SetTunable
- * @return Tunable
+ * @return the Tunable associated with a setter method
*/
Tunable getSetTunable();
}
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.