SOURCECODE |
How to... select a Time type
Description:
A Time Object is used by the Timer. It gives the Timer itīs certain shape.
The Time Object defines which time field will be increased by goAhead method of the Timer.
(See also: HowTo..select a Timer type and HowTo..incorporate a Timer )
Choose of following Timer types:
Date : "01.01.00" a simple date of the format:"dd.mm.yy".
Step : "26" a Long value is used to represent the time.
CalendarTime : "Sat Jul 20 15:38:53 CEST 2002" a time which is represented as a Gregorian Calendar
ToDo's:
- Coose fitting type of Time.
- Make a new instance of Time. ( ex.:
Time t = new Step()
)
- CalendarTime enables changing time intervall.
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:
Time Date Step CalendarTime Timer StepTimer AutoTimer
// mainly imports
import sale.Time;
import sale.CalendarTime;
//...
2
// initialize Time with current system time
Time time = new CalendarTime();
3
// if Timer with this Time calls goAhead method it will increase time by one sec
((CalendarTime) time).setTimeToCount(CalendarTime.SECOND);
//...