speedscheduler
Class TimeUtils

java.lang.Object
  extended by speedscheduler.TimeUtils

public class TimeUtils
extends java.lang.Object

Some handy constances and helper functions for working with times and such.


Field Summary
static int WEEK_LEN
          Number of days in a week
 
Constructor Summary
TimeUtils()
           
 
Method Summary
private static java.util.Calendar getCurrentCalendar()
           
static int getCurrentDayIndex()
          Returns the day of the week indexed at 0.
static Time getCurrentTime()
          Returns the current time according to the computer as a Time object.
static java.lang.String getDayName(int dayOfWeekIndex)
          Utility to translate the dayOfWeek index to a human-readable string.
static java.lang.String getShortDayName(int dayOfWeekIndex)
          Gets the name of the day by week index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WEEK_LEN

public static final int WEEK_LEN
Number of days in a week

See Also:
Constant Field Values
Constructor Detail

TimeUtils

public TimeUtils()
Method Detail

getShortDayName

public static java.lang.String getShortDayName(int dayOfWeekIndex)
Gets the name of the day by week index.

Parameters:
dayOfWeekIndex - the week index, 0: Sunday, 6: Saturday.
Returns:

getDayName

public static java.lang.String getDayName(int dayOfWeekIndex)
Utility to translate the dayOfWeek index to a human-readable string.

Returns:
A string representing the day of the week, ie, "Sunday", "Wednesday", etc.

getCurrentTime

public static Time getCurrentTime()
Returns the current time according to the computer as a Time object. This will only be as accurate as the computer's clock.


getCurrentDayIndex

public static int getCurrentDayIndex()
Returns the day of the week indexed at 0.


getCurrentCalendar

private static java.util.Calendar getCurrentCalendar()