I have following class diagram (visitor pattern implementation):
Expected result:
1) WiredVisitor should visit only Router and WiredNetworkCard
2)
You could do this for example:
public interface IVisitor {
public void visit( T card );
}
And then you'd define your visitors as:
public class WiredVisitor implements IVisitor {
...
}
public class WirelessVisitor implements IVisitor {
...
}
This may not be the textbook solution but it's very clean and very readable.