示例#1
0
 public void accept(CarElementVisitor visitor)
 {
     foreach (CarElement element in _elements)
     {
         element.accept(visitor);
     }
 }
示例#2
0
 public void accept(CarElementVisitor visitor)
 {
     foreach (var element in this.getElements())
     {
         element.accept(visitor);
     }
     visitor.visit(this);
 }
示例#3
0
 public void accept(CarElementVisitor visitor)
 {
     foreach (CarElement elem in elements)
     {
         elem.accept(visitor);
     }
     visitor.visit(this);
 }
示例#4
0
 public void accept(CarElementVisitor visitor)
 {
     /*
      * accept(CarElementVisitor) in Wheel implements
      * accept(CarElementVisitor) in CarElement, so the call
      * to accept is bound at run time. This can be considered
      * the *first* dispatch. However, the decision to call
      * visit(Wheel) (as opposed to visit(Engine) etc.) can be
      * made during compile time since 'this' is known at compile
      * time to be a Wheel. Moreover, each implementation of
      * CarElementVisitor implements the visit(Wheel), which is
      * another decision that is made at run time. This can be
      * considered the *second* dispatch.
      */
     visitor.visit(this);
 }
示例#5
0
 public void accept(CarElementVisitor visitor)
 {
     visitor.visit(this);
 }