Module hw06

Class Visitor1

java.lang.Object
provided.basicVisitorFW.visitors.Visitor1
All Implemented Interfaces:
IVisitor

public class Visitor1 extends Object implements IVisitor
A visitor that returns a String that says "This is the result from HostX, where HostX is the type of the IHost object executing this visitor.
Author:
swong
  • Constructor Details

    • Visitor1

      public Visitor1()
  • Method Details

    • caseHostA

      public Object caseHostA(HostA host, Object... params)
      Description copied from interface: IVisitor
      Case for HostA
      Specified by:
      caseHostA in interface IVisitor
      Parameters:
      host - The HostA instance
      params - Optional input parameters
      Returns:
      The result of processing HostA with the given parameters.
    • caseHostB

      public Object caseHostB(HostB host, Object... params)
      Description copied from interface: IVisitor
      Case for HostB
      Specified by:
      caseHostB in interface IVisitor
      Parameters:
      host - The HostB instance
      params - Optional input parameters
      Returns:
      The result of processing HostB with the given parameters.
    • caseHostC

      public Object caseHostC(HostC host, Object... params)
      Description copied from interface: IVisitor
      Case for HostC
      Specified by:
      caseHostC in interface IVisitor
      Parameters:
      host - The HostC instance
      params - Optional input parameters
      Returns:
      The result of processing HostC with the given parameters.
    • toString

      public String toString()
      Overrides:
      toString in class Object