SOURCECODE

How to... select a Timer type


Description:
A Timer is able to manage the current time in your application. It is referenced to a Time which gives the Timer itīs shape.
(See also: HowTo..select a Time type and HowTo..incorporate a Timer )
Choose of following Timer types:
  • StepTimer : very simple implementation, is increased manually by goAhead() method.

  • AutoTimer : special step timer which inceases automatically with a certain time delay.


  • ToDo's:
    1. Coose fitting type of Timer.
    2. Make a new instance of Timer. ( ex.: Timer t = new StepTimer() )

    Time management in SalesPoint Framework is abutted on several Java classes:
    java.util.Calendar, java.util.GregorianCalendar, java.util.Date, java.util.Timer, java.util.TimerTask, java.util.TimeZone
    java.sql.Date, java.sql.Time, java.sql.Timestamp

    Uses:
    Timer  StepTimer  AutoTimer  Time  Date  Step  CalendarTime  



    SourceCode

    // mainly imports
       import sale.Time;
       import sale.Date;
       import sale.Timer;
       import sale.StepTimer;


          //...

          // initialize Time with current system time
             Time date = new Date("19.07.02");

           2
          // initialize Timer with Date
             StepTimer stepper = new StepTimer(date);

          //...