SalesPoint Framework v3.0

sale
Interface Time

All Known Implementing Classes:
Date, Step, CalendarTime

public interface Time
extends Serializable

Interface used by implementations of the Timer interface.

So, it is possible for a timer to deal with different time formats.

Hooks:
Define Time Representation
Since:
v2.0
Version:
2.0 11/06/1999
Author:
Stephan Gambke

Method Summary
 Object getDefaultInterval()
          Get the default interval to be used by timers.
 Object getTime()
          Get the current time.
 Comparable getTimeStamp(long lStampNumber)
          Create and return a time stamp.
 void goAhead(Object oInterval)
          Increases the current time by the given interval.
 void setTime(Object oTime)
          Set the time.
 

Method Detail

setTime

public void setTime(Object oTime)
             throws IllegalArgumentException
Set the time.
Override:
Always.
Parameters:
oTime - the time to be set

getTime

public Object getTime()
Get the current time.

The returned object should have a useful toString() method, so that the time can be printed in a meaningful way.

Override:
Always.
Returns:
an object representing the current time.

goAhead

public void goAhead(Object oInterval)
             throws IllegalArgumentException
Increases the current time by the given interval.
Override:
Always.
Parameters:
oInterval - the interval

getDefaultInterval

public Object getDefaultInterval()
Get the default interval to be used by timers.

This method is required for calls of Timer.goAhead() before the Timer.setInterval() method was called.

Override:
Always.
Returns:
an object representing a valid interval for this Time object

getTimeStamp

public Comparable getTimeStamp(long lStampNumber)
Create and return a time stamp.

The returned time stamps have to be in a natural order that is identical to the order of creation. A good idea would be a String consisting of the time in a correctly sortable format followed by a value representing the stamp number in this time interval.

More formally two time stamps a and b must fulfil the following conditions:

Override:
Always.
Parameters:
lStampNumber - the number of the stamp
Returns:
a time stamp that fulfills the above conditions.

SalesPoint Framework v3.0