Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue 1968 and correct visitor pattern code #1990

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add Javadoc and comments for issue
  • Loading branch information
xyllq999 committed Apr 24, 2022
commit 36b7b77c57d33e0a3d09d911ef502c90336c8e9e
2 changes: 1 addition & 1 deletion visitor/src/main/java/com/iluwatar/visitor/Commander.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public Commander(Unit... children) {

/**
* Accept a Visitor.
* @param visitor
* @param visitor An implementation class of Unit.
*/
@Override
public void accept(UnitVisitor visitor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class CommanderVisitor implements UnitVisitor {

/**
* Soldier Visitor method.
* @param soldier
* @param soldier An implementation class of Unit.
*/
@Override
public void visit(Soldier soldier) {
Expand All @@ -43,7 +43,7 @@ public void visit(Soldier soldier) {

/**
* Sergeant Visitor method.
* @param sergeant
* @param sergeant An implementation class of Unit.
*/
@Override
public void visit(Sergeant sergeant) {
Expand All @@ -52,7 +52,7 @@ public void visit(Sergeant sergeant) {

/**
* Commander Visitor method.
* @param commander
* @param commander An implementation class of Unit.
*/
@Override
public void visit(Commander commander) {
Expand Down
2 changes: 1 addition & 1 deletion visitor/src/main/java/com/iluwatar/visitor/Sergeant.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public Sergeant(Unit... children) {

/**
* Accept a visitor.
* @param visitor
* @param visitor An implementation class of Unit.
*/
@Override
public void accept(UnitVisitor visitor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class SergeantVisitor implements UnitVisitor {

/**
* Soldier Visitor method.
* @param soldier
* @param soldier An implementation class of Unit.
*/
@Override
public void visit(Soldier soldier) {
Expand All @@ -43,7 +43,7 @@ public void visit(Soldier soldier) {

/**
* Sergeant Visitor method.
* @param sergeant
* @param sergeant An implementation class of Unit.
*/
@Override
public void visit(Sergeant sergeant) {
Expand All @@ -52,7 +52,7 @@ public void visit(Sergeant sergeant) {

/**
* Commander Visitor method.
* @param commander
* @param commander An implementation class of Unit.
*/
@Override
public void visit(Commander commander) {
Expand Down
2 changes: 1 addition & 1 deletion visitor/src/main/java/com/iluwatar/visitor/Soldier.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public Soldier(Unit... children) {

/**
* Accept a visitor.
* @param visitor
* @param visitor An implementation class of Unit.
*/
@Override
public void accept(UnitVisitor visitor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class SoldierVisitor implements UnitVisitor {

/**
* Soldier visitor method.
* @param soldier
* @param soldier An implementation class of Unit.
*/
@Override
public void visit(Soldier soldier) {
Expand All @@ -44,7 +44,7 @@ public void visit(Soldier soldier) {

/**
* Sergeant visitor method.
* @param sergeant
* @param sergeant An implementation class of Unit.
*/
@Override
public void visit(Sergeant sergeant) {
Expand All @@ -53,7 +53,7 @@ public void visit(Sergeant sergeant) {

/**
* Commander visitor method.
* @param commander
* @param commander An implementation class of Unit.
*/
@Override
public void visit(Commander commander) {
Expand Down
6 changes: 3 additions & 3 deletions visitor/src/main/java/com/iluwatar/visitor/UnitVisitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ public interface UnitVisitor {

/**
* Soldier visit method.
* @param soldier
* @param soldier An implementation class of Unit.
*/
void visit(Soldier soldier);

/**
* Sergeant visit method.
* @param sergeant
* @param sergeant An implementation class of Unit.
*/
void visit(Sergeant sergeant);

/**
* Commander visit method.
* @param commander
* @param commander An implementation class of Unit.
*/
void visit(Commander commander);

Expand Down