/*PLEASE DO NOT EDIT THIS CODE*/
/*This code was generated using the UMPLE @UMPLE_VERSION@ modeling language!*/

package example;
import cruise.util.FileTracer;

public class Tracer
{

  //------------------------
  // MEMBER VARIABLES
  //------------------------

  //Tracer Attributes
  private int id;
  private String name;

  //------------------------
  // CONSTRUCTOR
  //------------------------

  public Tracer(int aId, String aName)
  {
    id = aId;
    ( new Thread()
    {
      Thread thread;
      {
        thread = Thread.currentThread();
      }
      public void run()
      {
        while( thread.isAlive() )
        {
              FileTracer.handle( System.currentTimeMillis()+","+Thread.currentThread().getId()+",TraceMultipleAttributePeriod.ump,7,Tracer,"+System.identityHashCode(this)+",at_p,id,"+id );
          try
          {
            Thread.sleep(30ms);
          }
          catch (InterruptedException e)
          {
            e.printStackTrace();
          }
        }
      }
    }
    ).start();
    name = aName;
    ( new Thread()
    {
      Thread thread;
      {
        thread = Thread.currentThread();
      }
      public void run()
      {
        while( thread.isAlive() )
        {
              FileTracer.handle( System.currentTimeMillis()+","+Thread.currentThread().getId()+",TraceMultipleAttributePeriod.ump,7,Tracer,"+System.identityHashCode(this)+",at_p,name,"+name );
          try
          {
            Thread.sleep(30ms);
          }
          catch (InterruptedException e)
          {
            e.printStackTrace();
          }
        }
      }
    }
    ).start();
  }

  //------------------------
  // INTERFACE
  //------------------------

  public boolean setId(int aId)
  {
    boolean wasSet = false;
    id = aId;
    wasSet = true;
    return wasSet;
  }

  public boolean setName(String aName)
  {
    boolean wasSet = false;
    name = aName;
    wasSet = true;
    return wasSet;
  }

  public int getId()
  {
    return id;
  }

  public String getName()
  {
    return name;
  }

  public void delete()
  {}


  public String toString()
  {
    return super.toString() + "["+
            "id" + ":" + getId()+ "," +
            "name" + ":" + getName()+ "]";
  }
}
