edu.wpi.cs.dsrg.xmldb.xat.common.visitorpattern
Class TwoParamVisitor
java.lang.Object
|
+--edu.wpi.cs.dsrg.xmldb.xat.common.visitorpattern.InheritableVisitor
|
+--edu.wpi.cs.dsrg.xmldb.xat.common.visitorpattern.TwoParamVisitor
- Direct Known Subclasses:
- MergeVisitor, ReWriteRules
- public abstract class TwoParamVisitor
- extends InheritableVisitor
This class looks over the interfaces of the objects
- Since:
- 1.0
Method Summary |
abstract java.lang.Object |
dispatch(java.lang.Object obj1,
java.lang.Object obj2)
To visit two objects. |
protected java.lang.reflect.Method |
getMethod(java.lang.Class c1,
java.lang.Class c2)
This method try to find the method for both classes. |
java.lang.Object |
visit(java.lang.Object obj1,
java.lang.Object obj2)
If there is an inheretance between the visited objects, it will only match the
highest class. |
java.lang.Object |
visit(Visitable obj1,
Visitable obj2)
In some case, the visit() will call the visitable, which is
the highest interface in the visitor pattern. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
TwoParamVisitor
public TwoParamVisitor()
dispatch
public abstract java.lang.Object dispatch(java.lang.Object obj1,
java.lang.Object obj2)
- To visit two objects.
- Since:
- 1.0
getMethod
protected java.lang.reflect.Method getMethod(java.lang.Class c1,
java.lang.Class c2)
- This method try to find the method for both classes.
- Parameters:
c1
- The first class.c2
- The second class.- Returns:
- Method The common method for both classes.
- Since:
- 1.0
visit
public java.lang.Object visit(Visitable obj1,
Visitable obj2)
- In some case, the visit() will call the visitable, which is
the highest interface in the visitor pattern. In that case, we just
lead it to the visit(object) method to dynamically find out where
you should go.
- Parameters:
obj1
- The first visitable object.obj2
- The second visitable object.- Returns:
- Object
- Since:
- 1.0
visit
public java.lang.Object visit(java.lang.Object obj1,
java.lang.Object obj2)
- If there is an inheretance between the visited objects, it will only match the
highest class.
- Parameters:
obj1
- The first object.obj2
- The second object.- Returns:
- Object
- Since:
- 1.0