SalesPoint Framework v3.0

sale
Class CalendarTime

java.lang.Object
  |
  +--sale.CalendarTime

public class CalendarTime
extends Object
implements Time

This class is an implementation of the Time interface.

The time is represented as a Gregorian Calendar.

Only a simple Adapterclass for java.util.GregorianCalendar

Since:
v2.0
Version:
2.0 29/11/2000
Author:
Thomas Medack
See Also:
Serialized Form

Field Summary
static int DATE
          Field number for setTimeToCount(int) indicates that the days will be increased by goAhead(java.lang.Object)
static int HOUR
          Field number for setTimeToCount(int) indicates that the hours will be increased by goAhead(java.lang.Object)
static int MINUTE
          Field number for setTimeToCount(int) indicates that the minutes will be increased by goAhead(java.lang.Object)
static int MONTH
          Field number for setTimeToCount(int) indicates that the month will be increased by goAhead(java.lang.Object)
static int SECOND
          Field number for setTimeToCount(int) indicates that the seconds will be increased by goAhead(java.lang.Object)
static int YEAR
          Field number for setTimeToCount(int) indicates that the years will be increased by goAhead(java.lang.Object)
 
Constructor Summary
CalendarTime()
          Creates a new CalendarTime with the current systemtime.
CalendarTime(int year, int month, int date, int hours, int minutes, int seconds)
          Creates a new CalendarTime with the given starting time
CalendarTime(int year, int month, int date, int hours, int minutes, int seconds, int iTimeToCount)
          Creates a new CalendarTime with the given starting time and an int that defines the field which will be increased by goAhead(java.lang.Object).
CalendarTime(long lTimeInMillis)
          Creates a new CalendarTime with the given starting time.
CalendarTime(long lTimeInMillis, int iTimeToCount)
          Creates a new CalendarTime with the given starting time and an int that defines the field which will be increased by goAhead(java.lang.Object).
 
Method Summary
 Calendar getCalendar()
          Get the adapted Calendar.
 Object getDefaultInterval()
          Get the default time interval.
 Object getTime()
          Get the calendars date
 Comparable getTimeStamp(long lStampNumber)
          Create and return a time stamp.
 void goAhead(Object oInterval)
          Increment the time by the given time interval.
static void main(String[] args)
           
 void setTime(Object oTime)
          Set the given date.
 void setTimeToCount(int iTime)
          Set an int that will define which time field will be increased by goAhead(java.lang.Object).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SECOND

public static int SECOND
Field number for setTimeToCount(int) indicates that the seconds will be increased by goAhead(java.lang.Object)

MINUTE

public static int MINUTE
Field number for setTimeToCount(int) indicates that the minutes will be increased by goAhead(java.lang.Object)

HOUR

public static int HOUR
Field number for setTimeToCount(int) indicates that the hours will be increased by goAhead(java.lang.Object)

DATE

public static int DATE
Field number for setTimeToCount(int) indicates that the days will be increased by goAhead(java.lang.Object)

MONTH

public static int MONTH
Field number for setTimeToCount(int) indicates that the month will be increased by goAhead(java.lang.Object)

YEAR

public static int YEAR
Field number for setTimeToCount(int) indicates that the years will be increased by goAhead(java.lang.Object)
Constructor Detail

CalendarTime

public CalendarTime()
Creates a new CalendarTime with the current systemtime.

CalendarTime

public CalendarTime(long lTimeInMillis)
Creates a new CalendarTime with the given starting time.
Parameters:
lTimeInMillis - a long representing the time in milliseconds

CalendarTime

public CalendarTime(long lTimeInMillis,
                    int iTimeToCount)
Creates a new CalendarTime with the given starting time and an int that defines the field which will be increased by goAhead(java.lang.Object).
Parameters:
lTimeInMillis - a long representing the time in milliseconds
iTimeToCount - an int representing the field which will be increased by goAhead(java.lang.Object)
See Also:
YEAR, MONTH, DATE, HOUR, MINUTE, SECOND

CalendarTime

public CalendarTime(int year,
                    int month,
                    int date,
                    int hours,
                    int minutes,
                    int seconds)
Creates a new CalendarTime with the given starting time
Parameters:
year - an int representing the Year you want to start with
month - an int representing the Month you want to start with
date - an int representing the Day you want to start with
hours - an int representing the Hour you want to start with
minutes - an int representing the Minute you want to start with
seconds - an int representing the Second you want to start with

CalendarTime

public CalendarTime(int year,
                    int month,
                    int date,
                    int hours,
                    int minutes,
                    int seconds,
                    int iTimeToCount)
Creates a new CalendarTime with the given starting time and an int that defines the field which will be increased by goAhead(java.lang.Object).
Parameters:
year - an int representing the Year you want to start with
month - an int representing the Month you want to start with
date - an int representing the Day you want to start with
hours - an int representing the Hour you want to start with
minutes - an int representing the Minute you want to start with
seconds - an int representing the Second you want to start with
iTimeToCount - an int representing the field which will be increased by goAhead(java.lang.Object)
See Also:
YEAR, MONTH, DATE, HOUR, MINUTE, SECOND
Method Detail

setTime

public void setTime(Object oTime)
             throws IllegalArgumentException
Set the given date.
Override:
Never.
Specified by:
setTime in interface Time
Parameters:
oTime - a java.util.Date representing the date to be set
Throws:
IllegalArgumentException - if Parameter is not a java.util.Date

setTimeToCount

public void setTimeToCount(int iTime)
Set an int that will define which time field will be increased by goAhead(java.lang.Object).
Override:
Never.
Parameters:
iTime - an int representing a constant
See Also:
YEAR, MONTH, DATE, HOUR, MINUTE, SECOND

getTime

public Object getTime()
Get the calendars date
Override:
Never.
Specified by:
getTime in interface Time
Returns:
a java.util.Date representing the calendars date

goAhead

public void goAhead(Object oInterval)
             throws IllegalArgumentException
Increment the time by the given time interval.
Override:
Never.
Specified by:
goAhead in interface Time
Parameters:
oInterval - the interval by which to increment time. Must be an Integer object that gives the number of days by which to increment.
Throws:
IllegalArgumentException - if the given interval is no Integer or is null.

getDefaultInterval

public Object getDefaultInterval()
Get the default time interval.
Override:
Never.
Specified by:
getDefaultInterval in interface Time
Returns:
an Integer describing the default time step.

getCalendar

public Calendar getCalendar()
Get the adapted Calendar.
Override:
Never.
Returns:
a Calendar object describing the calendar of this class.

getTimeStamp

public Comparable getTimeStamp(long lStampNumber)
Create and return a time stamp.
Override:
Never.
Specified by:
getTimeStamp in interface Time
Parameters:
lStampNumber - the number of the stamp
Returns:
a fresh time stamp.

main

public static void main(String[] args)

SalesPoint Framework v3.0