SalesPoint Framework v3.1

sale
Class CalendarTime

java.lang.Object
  extended bysale.CalendarTime
All Implemented Interfaces:
Serializable, Time

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
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.
 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).
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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.

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
Override:
Never

setTimeToCount

public void setTimeToCount(int iTime)
Set an int that will define which time field will be increased by goAhead(java.lang.Object).

Parameters:
iTime - an int representing a constant
See Also:
YEAR, MONTH, DATE, HOUR, MINUTE, SECOND
Override:
Never

getTime

public Object getTime()
Get the calendars date

Specified by:
getTime in interface Time
Returns:
a java.util.Date representing the calendars date
Override:
Never

goAhead

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

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.
Override:
Never

getDefaultInterval

public Object getDefaultInterval()
Get the default time interval.

Specified by:
getDefaultInterval in interface Time
Returns:
an Integer describing the default time step.
Override:
Never

getCalendar

public Calendar getCalendar()
Get the adapted Calendar.

Returns:
a Calendar object describing the calendar of this class.
Override:
Never

getTimeStamp

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

Specified by:
getTimeStamp in interface Time
Parameters:
lStampNumber - the number of the stamp
Returns:
a fresh time stamp.
Override:
Never

toString

public String toString()
Returns:
a string representation of this date.

SalesPoint Framework v3.1