#107 Improve JavaDoc for Visitor example
This commit is contained in:
visitor/src
@ -5,15 +5,19 @@ package com.iluwatar.visitor;
|
|||||||
* Visitor pattern defines mechanism to apply operations on nodes
|
* Visitor pattern defines mechanism to apply operations on nodes
|
||||||
* in hierarchy. New operations can be added without altering the node
|
* in hierarchy. New operations can be added without altering the node
|
||||||
* interface.
|
* interface.
|
||||||
*
|
* <p>
|
||||||
* In this example there is a unit hierarchy beginning from Commander.
|
* In this example there is a unit hierarchy beginning from {@link Commander}.
|
||||||
* This hierarchy is traversed by visitors. SoldierVisitor applies
|
* This hierarchy is traversed by visitors. {@link SoldierVisitor} applies
|
||||||
* its operation on Soldiers, SergeantVisitor on Sergeants and so
|
* its operation on {@link Soldier}s, {@link SergeantVisitor} on {@link Sergeant}s and so
|
||||||
* on.
|
* on.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class App {
|
public class App {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Program entry point
|
||||||
|
* @param args command line args
|
||||||
|
*/
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
Commander commander = new Commander(new Sergeant(new Soldier(),
|
Commander commander = new Commander(new Sergeant(new Soldier(),
|
||||||
|
@ -4,6 +4,11 @@ import org.junit.Test;
|
|||||||
|
|
||||||
import com.iluwatar.visitor.App;
|
import com.iluwatar.visitor.App;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Application test
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class AppTest {
|
public class AppTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Reference in New Issue
Block a user