first task is to understand what visitor pattern is, how it is created,
how and why it works.
This might take 1/2
hour of your time, more or less, to get the idea. If you have questions, ASK!
2. Quark ApplicationQuark is an simple Java GUI. A class diagram of its organization is shown below:
The root is an abstract class called Tree, which has 4 methods (there may be more methods, but only these are shown):
classes in this hierarchy implement or inherit these methods. The
semantics (meaning) of these methods is not significant for this
assignment, only to the extent that one of these methods (to be revealed
later) will be involved with a visitor pattern. Here is your task:
- tree apply(I i)
- tree apply(A a)
- tree apply(H h)
- tree apply(G g)
- Download the quark jar file. In the same directory, you can invoke it by:
> java -jar Quark.jar
Note: if you can't execute Quark.jar (you get a Major/Minor error), your JDK/JRE is out of date. Use JRE1.7, JDK1.7+.
What you can do is just jump to Step 3 below, install Eclipse. In the following assignment, I will give you the source
for Quark and you can compile and run it then.
Spend a minute or so on the above.
- Run quark just to see what it does (you don't have to understand its meaning).
and install Eclipse
JDT Classic 4.2.2 (Juno).
Use ONLY this version of Eclipse.