// ==========================================================================
// $Id: Timer.java,v 1.4 2002/09/01 15:48:32 hitoshi Exp $
// Timer 
// ==========================================================================
// Copyright (C) 2002 Yamauchi, Hitoshi
//
//   Max-Planck-Institut fuer Informatik AG4
//   Stuhlsatzenhausweg 85, 66123 Saarbruecken
//   http://www.mpi-sb.mpg.de/
// 
// This software can be redistributed only under GNU copyleft.
//
// @author Yamauchi Hitoshi »³Æâ ÀÆ
// ==========================================================================
// $Revision: 1.4 $
// $Date: 2002/09/01 15:48:32 $
// $Author: hitoshi $
// ==========================================================================
package de.mpg.mpisb.timerclock;

import  java.util.*;

/**
 * set start time and end time, start and stop action, and get the time.
 */
public abstract class Timer
{
  /**
   * constructor
   */
  public Timer()
  {
    this.mPeriod = 0;
  }
  
  /**
   * Set the Period. Milliseconds
   * @param v  Value to assign to Period.
   */
  public void setPeriod(long v)
  {
    this.mPeriod = v;
  }
  /**
   * Get the value of Period. Milliseconds
   * @return Value of Period.
   */
  public long getPeriod() 
  {
    return(this.mPeriod);
  }

  /** 
   * reset timer
   */
  public abstract void reset();

  /** 
   * start timer
   */
  public abstract void start();
  
  /** 
   * stop timer
   */
  public abstract void stop();

  /**
   * get current display time 
   */
  public abstract long getCurrentDisplayTime();

  /**
   * get current elapsed time 
   */
  public abstract long getCurrentElapsedTime();

  /**
   * string representation
   */
  public String toString()
  {
    String r = "Period = " + this.getPeriod();
    return(r);
  }
  
  // private variables
  private long mPeriod;
}
