// ** This class was generated with DemFGen (vers:09/27/2009)


public class InlineToString{
   private ToString func;
   public InlineToString(ToString f){ func = f; }

   public String traverse(Pict _h){ return traversePict(_h); }

   public String traverseSquare(Square _h){
      String _size = func.combine(_h.size);
      /*[0..0]*/
      if((_h instanceof Square)){
         return func.combine((Square)_h,(String)_size);
      }else{
         return func.combine((Pict)_h);
      }
   }
   public String traversePict(Pict _h){
      if(_h instanceof Overlay) return this.traverseOverlay((Overlay)_h);
      if(_h instanceof Offset) return this.traverseOffset((Offset)_h);
      if(_h instanceof Circle) return this.traverseCircle((Circle)_h);
      if(_h instanceof Square) return this.traverseSquare((Square)_h);
      else throw new RuntimeException("Unknown Pict Variant");
   }
   public String traverseOverlay(Overlay _h){
      String _top = traversePict(_h.top);
      String _bot = traversePict(_h.bot);
      /*[0..0]*/
      if((_h instanceof Overlay)){
         return func.combine((Overlay)_h,(String)_top, (String)_bot);
      }else{
         return func.combine((Pict)_h);
      }
   }
   public String traverseOffset(Offset _h){
      String _dx = func.combine(_h.dx);
      String _dy = func.combine(_h.dy);
      String _inner = traversePict(_h.inner);
      /*[0..0]*/
      if((_h instanceof Offset)){
         return func.combine((Offset)_h,(String)_dx, (String)_dy, (String)_inner);
      }else{
         return func.combine((Pict)_h);
      }
   }
   public String traverseCircle(Circle _h){
      String _rad = func.combine(_h.rad);
      /*[0..0]*/
      if((_h instanceof Circle)){
         return func.combine((Circle)_h,(String)_rad);
      }else{
         return func.combine((Pict)_h);
      }
   }

}