SalesPoint Framework v3.1

sale
Interface Time

All Superinterfaces:
Serializable
All Known Implementing Classes:
CalendarTime, Date, Step

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.

Since:
v2.0
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.

Parameters:
oTime - the time to be set
Throws:
IllegalArgumentException - if the time does not meet the time object's class or format requirements
Override:
Always

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.

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

goAhead

public void goAhead(Object oInterval)
             throws IllegalArgumentException
Increases the current time by the given interval.

Parameters:
oInterval - the interval
Throws:
IllegalArgumentException - if the interval does not meet the time object's class or format requirements
Override:
Always

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.

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

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:

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

SalesPoint Framework v3.1