Module hw06

Interface IVisitor

All Known Implementing Classes:
Visitor1, Visitor2

public interface IVisitor
An abstract visitor to an IHost object. Provides cases for each IHost subclass type.
Author:
swong
  • Field Details

    • NULL_VISITOR

      static final IVisitor NULL_VISITOR
      A null visitor, used when no visitor is yet defined. Simply returns a string indicating which host executed this visitor.
  • Method Details

    • caseHostA

      Object caseHostA(HostA host, Object... params)
      Case for HostA
      Parameters:
      host - The HostA instance
      params - Optional input parameters
      Returns:
      The result of processing HostA with the given parameters.
    • caseHostB

      Object caseHostB(HostB host, Object... params)
      Case for HostB
      Parameters:
      host - The HostB instance
      params - Optional input parameters
      Returns:
      The result of processing HostB with the given parameters.
    • caseHostC

      Object caseHostC(HostC host, Object... params)
      Case for HostC
      Parameters:
      host - The HostC instance
      params - Optional input parameters
      Returns:
      The result of processing HostC with the given parameters.