com.cassinidivision.core.foundation
Class NSTimestamp_Helper

java.lang.Object
  extended bycom.cassinidivision.core.foundation.NSTimestamp_Helper

public class NSTimestamp_Helper
extends Object

NSTimestamp-based utility methods.


Constructor Summary
NSTimestamp_Helper()
           
 
Method Summary
static int dayOfMonth(NSTimestamp myNSTimestamp)
          Cover for deprecated NSTimestamp.dayOfMonth() method.
static int dayOfWeek(NSTimestamp myNSTimestamp)
          Cover for deprecated NSTimestamp.dayOfWeek() method.
static NSTimestamp earliestDateFromArray(NSArray arrayOfDates)
          Retrieve the earliest timestamp in an array of timestamps.
static NSTimestamp firstDayOfMonth(NSTimestamp myDate)
          Retrieve the first day of the month corresponding to the month in the timestamp supplied.
static NSTimestamp firstDayOfWeek(NSTimestamp myDate)
          Retrieve the first day of the week corresponding to the day supplied in the timestamp.
static int hourOfDay(NSTimestamp myNSTimestamp)
          Cover for deprecated NSTimestamp.dayOfMonth() method.
static NSTimestamp lastDayOfMonth(NSTimestamp myDate)
          Retrieve the last day of the month corresponding to the month in the timestamp supplied.
static NSTimestamp lastDayOfWeek(NSTimestamp myDate)
          Retrieve the last day of the week corresponding to the day supplied in the timestamp.
static NSTimestamp lastMonth(NSTimestamp myDate)
          Retrieve a timestamp one month ago (time of day set to midnight).
static NSTimestamp lastSecondOfSameDay(NSTimestamp myDate)
          Retrieve the final second in the day (23:59:59) corresponding to the timestamp specified.
static NSTimestamp lastWeek(NSTimestamp myDate)
          Retrieve a timestamp for the previous week (time of day set to midnight).
static NSTimestamp midnightOnSameDay(NSTimestamp myDate)
          Retrieve the first second in the day (00:00:00) corresponding to the timestamp specified.
static int minuteOfDay(NSTimestamp myDate)
          Retrieve the number of minutes that have elapsed since midnight for the timestamp specified.
static int minuteOfHour(NSTimestamp myNSTimestamp)
          Cover for deprecated NSTimestamp.minuteOfHour() method.
static int minuteOfWeek(NSTimestamp myDate)
          Retrieve the number of minutes that have elapsed since the beginning of the week (midnight on Sunday) for the timestamp specified.
static int monthOfYear(NSTimestamp myNSTimestamp)
          Cover for deprecated NSTimestamp.monthOfYear() method.
static NSTimestamp nextMonday(NSTimestamp myDate)
          Retrieve the next Monday following the date supplied in the timestamp.
static NSTimestamp nextMonth(NSTimestamp myDate)
          Retrieve a timestamp one month ahead (time of day set to midnight).
static NSTimestamp nextWeek(NSTimestamp myDate)
          Retrieve a timestamp for the week ahead (time of day set to midnight).
static NSTimestamp tomorrow(NSTimestamp myDate)
          Retrieve a timestamp for the day ahead (time of day set to midnight).
static int yearOfCommonEra(NSTimestamp myNSTimestamp)
          Cover for deprecated NSTimestamp.yearOfCommonEra() method.
static NSTimestamp yesterday(NSTimestamp myDate)
          Retrieve a timestamp for the previous day (time of day set to midnight).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NSTimestamp_Helper

public NSTimestamp_Helper()
Method Detail

tomorrow

public static NSTimestamp tomorrow(NSTimestamp myDate)
Retrieve a timestamp for the day ahead (time of day set to midnight).

Parameters:
myDate - Original timestamp.
Returns:
The new timestamp.

nextWeek

public static NSTimestamp nextWeek(NSTimestamp myDate)
Retrieve a timestamp for the week ahead (time of day set to midnight).

Parameters:
myDate - Original timestamp.
Returns:
The new timestamp.

yesterday

public static NSTimestamp yesterday(NSTimestamp myDate)
Retrieve a timestamp for the previous day (time of day set to midnight).

Parameters:
myDate - Original timestamp.
Returns:
The new timestamp.

lastWeek

public static NSTimestamp lastWeek(NSTimestamp myDate)
Retrieve a timestamp for the previous week (time of day set to midnight).

Parameters:
myDate - Original timestamp.
Returns:
The new timestamp.

lastMonth

public static NSTimestamp lastMonth(NSTimestamp myDate)
Retrieve a timestamp one month ago (time of day set to midnight).

Parameters:
myDate - Original timestamp.
Returns:
The new timestamp.

nextMonth

public static NSTimestamp nextMonth(NSTimestamp myDate)
Retrieve a timestamp one month ahead (time of day set to midnight).

Parameters:
myDate - Original timestamp.
Returns:
The new timestamp.

firstDayOfMonth

public static NSTimestamp firstDayOfMonth(NSTimestamp myDate)
Retrieve the first day of the month corresponding to the month in the timestamp supplied.

Parameters:
myDate - Original timestamp.
Returns:
The new timestamp.

lastDayOfMonth

public static NSTimestamp lastDayOfMonth(NSTimestamp myDate)
Retrieve the last day of the month corresponding to the month in the timestamp supplied.

Parameters:
myDate - Original timestamp.
Returns:
The new timestamp.

firstDayOfWeek

public static NSTimestamp firstDayOfWeek(NSTimestamp myDate)
Retrieve the first day of the week corresponding to the day supplied in the timestamp.

Parameters:
myDate - Original timestamp.
Returns:
The new timestamp.

lastDayOfWeek

public static NSTimestamp lastDayOfWeek(NSTimestamp myDate)
Retrieve the last day of the week corresponding to the day supplied in the timestamp.

Parameters:
myDate - Original timestamp.
Returns:
The new timestamp.

nextMonday

public static NSTimestamp nextMonday(NSTimestamp myDate)
Retrieve the next Monday following the date supplied in the timestamp.

Parameters:
myDate - Original timestamp.
Returns:
The new timestamp.

minuteOfWeek

public static int minuteOfWeek(NSTimestamp myDate)
Retrieve the number of minutes that have elapsed since the beginning of the week (midnight on Sunday) for the timestamp specified.

Parameters:
myDate - Original timestamp.
Returns:
The new timestamp.

minuteOfDay

public static int minuteOfDay(NSTimestamp myDate)
Retrieve the number of minutes that have elapsed since midnight for the timestamp specified.

Parameters:
myDate - Original timestamp.
Returns:
The new timestamp.

midnightOnSameDay

public static NSTimestamp midnightOnSameDay(NSTimestamp myDate)
Retrieve the first second in the day (00:00:00) corresponding to the timestamp specified.

Parameters:
myDate - Original timestamp.
Returns:
The new timestamp.

lastSecondOfSameDay

public static NSTimestamp lastSecondOfSameDay(NSTimestamp myDate)
Retrieve the final second in the day (23:59:59) corresponding to the timestamp specified.

Parameters:
myDate - Original timestamp.
Returns:
The new timestamp.

earliestDateFromArray

public static NSTimestamp earliestDateFromArray(NSArray arrayOfDates)
Retrieve the earliest timestamp in an array of timestamps.

Parameters:
arrayOfDates - An array of NSTimestamp instances.
Returns:
The earliest timestamp found, or null if the array is empty.

yearOfCommonEra

public static int yearOfCommonEra(NSTimestamp myNSTimestamp)
Cover for deprecated NSTimestamp.yearOfCommonEra() method.

Parameters:
myNSTimestamp - Original timestamp.
Returns:
Four-digit year since 1AD.

monthOfYear

public static int monthOfYear(NSTimestamp myNSTimestamp)
Cover for deprecated NSTimestamp.monthOfYear() method.

Parameters:
myNSTimestamp - Original timestamp.
Returns:
Month value (1 to 12).

dayOfWeek

public static int dayOfWeek(NSTimestamp myNSTimestamp)
Cover for deprecated NSTimestamp.dayOfWeek() method.

Parameters:
myNSTimestamp - Original timestamp.
Returns:
Day value (0 to 6).

dayOfMonth

public static int dayOfMonth(NSTimestamp myNSTimestamp)
Cover for deprecated NSTimestamp.dayOfMonth() method.

Parameters:
myNSTimestamp - Original timestamp.
Returns:
Day value (1 to 31).

hourOfDay

public static int hourOfDay(NSTimestamp myNSTimestamp)
Cover for deprecated NSTimestamp.dayOfMonth() method.

Parameters:
myNSTimestamp - Original timestamp.
Returns:
Day value (1 to 31).

minuteOfHour

public static int minuteOfHour(NSTimestamp myNSTimestamp)
Cover for deprecated NSTimestamp.minuteOfHour() method.

Parameters:
myNSTimestamp - Original timestamp.
Returns:
Minute value (0 to 59).