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


public class InlineCompress{
   private Compress func;
   public InlineCompress(Compress f){ func = f; }

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

   public Square traverseSquare(Square _h){
      int _size = func.combine(_h.size);
      return func.combine((Square)_h, (int)_size);
   }
   public Pict 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 Overlay traverseOverlay(Overlay _h){
      Pict _top = traversePict(_h.top);
      Pict _bot = traversePict(_h.bot);
      return func.combine((Overlay)_h, (Pict)_top, (Pict)_bot);
   }
   public Offset traverseOffset(Offset _h){
      int _dx = func.combine(_h.dx);
      int _dy = func.combine(_h.dy);
      Pict _inner = traversePict(_h.inner);
      /*[3..3]*/
      if((_inner instanceof Offset)){
         return func.combine((Offset)_h, (int)_dx, (int)_dy, (Offset)_inner);
      }else{
         return func.combine((Offset)_h, (int)_dx, (int)_dy, (Pict)_inner);
      }
   }
   public Circle traverseCircle(Circle _h){
      int _rad = func.combine(_h.rad);
      return func.combine((Circle)_h, (int)_rad);
   }

}