Решение для шаблона посетителей: немногие посетители имеют одинаковый интерфейс, но должны работать с разными объектами

У меня есть следующая диаграмма классов (реализация шаблона посетителя):

enter image description here

Ожидаемый результат:
1) WiredVisitor должен посещать только Router и WiredNetworkCard
2) WirelessVisitor должен посещать только Router и WirelessNetworkCard

So, my question is: How should I change design (or code) for achieving my expected result?

P.S. My current solution is to add following piece of code to each visit(card:INetworkCard) method in both visitors:

// in WiredVisitor
if (card.getClass.equals(WiredNetworkCard.class)){
    // do logic of visit method
}

// in WirelessVisitor
if (card.getClass.equals(WirelessNetworkCard.class)){
    // do logic of visit method
}

Ответы на вопрос(4)

Ваш ответ на вопрос