Enhancing code format

This commit is contained in:
Argyro-Sioziou
2018-05-29 01:37:53 +03:00
parent 4023944240
commit afe85e22e7
8 changed files with 15 additions and 37 deletions

View File

@ -23,28 +23,17 @@
package com.iluwatar.acyclicvisitor;
/**
* The Acyclic Visitor pattern allows new
* functions to be added to existing class
* hierarchies without affecting those
* hierarchies, and without creating the
* dependency cycles that are inherent to
* the GoF Visitor pattern, by making the
* Visitor base class degenerate
* The Acyclic Visitor pattern allows new functions to be added to existing class
* hierarchies without affecting those hierarchies, and without creating the dependency
* cycles that are inherent to the GoF Visitor pattern, by making the Visitor base class
* degenerate
* <p>
* In this example the visitor base
* class is {@link ModemVisitor}.
* The base class of the visited
* hierarchy is {@link Modem} and
* has two children {@link Hayes}
* and {@link Zoom} each one having
* its own visitor interface {@link Hayes}
* and {@link ZoomVisitor} respectively.
* {@link ConfigureForUnixVisitor} and
* {@link ConfigureForDosVisitor} implement
* each derivative's visit method
* only if it is required
* In this example the visitor base class is {@link ModemVisitor}. The base class of the
* visited hierarchy is {@link Modem} and has two children {@link Hayes} and {@link Zoom}
* each one having its own visitor interface {@link Hayes} and {@link ZoomVisitor}
* respectively. {@link ConfigureForUnixVisitor} and {@link ConfigureForDosVisitor}
* implement each derivative's visit method only if it is required
*/
public class App {
/**

View File

@ -26,12 +26,9 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* CongigureForDosVisitor class
* implements both zoom's and
* hayes' visit method for Dos
* manufacturer
* CongigureForDosVisitor class implements both zoom's and hayes' visit method
* for Dos manufacturer
*/
public class ConfigureForDosVisitor implements ModemVisitor, HayesVisitor, ZoomVisitor {
private static final Logger LOGGER = LoggerFactory.getLogger(ConfigureForDosVisitor.class);

View File

@ -26,9 +26,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* CongigureForDosVisitor class
* implements both zoom's visit
* method for Unix manufacturer
* CongigureForDosVisitor class implements both zoom's visit method for Unix
* manufacturer
*/
public class ConfigureForUnixVisitor implements ModemVisitor, ZoomVisitor {

View File

@ -26,10 +26,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Hayes class implements its
* accept method
* Hayes class implements its accept method
*/
public class Hayes extends Modem {
private static final Logger LOGGER = LoggerFactory.getLogger(ConfigureForDosVisitor.class);

View File

@ -25,7 +25,6 @@ package com.iluwatar.acyclicvisitor;
/**
* Modem abstract class
*/
public abstract class Modem {
public abstract void accept(ModemVisitor modemVisitor);
}

View File

@ -25,7 +25,6 @@ package com.iluwatar.acyclicvisitor;
/**
* ZoomVisitor interface
*/
public interface ModemVisitor {
// Visitor is a degenerate base class for all visitors.
}

View File

@ -26,10 +26,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Zoom class implements its
* accept method
* Zoom class implements its accept method
*/
public class Zoom extends Modem {
private static final Logger LOGGER = LoggerFactory.getLogger(ConfigureForDosVisitor.class);

View File

@ -25,7 +25,6 @@ package com.iluwatar.acyclicvisitor;
/**
* ZoomVisitor interface
*/
public interface ZoomVisitor {
void visit(Zoom zoom);
}