org.jsmpp.util
Class RelativeTimeFormatter

java.lang.Object
  extended by org.jsmpp.util.RelativeTimeFormatter
All Implemented Interfaces:
TimeFormatter

public class RelativeTimeFormatter
extends java.lang.Object
implements TimeFormatter

Relative time formatter is TimeFormatter implementation referred to SMPP Protocol Specification v3.4 point 7.1.1.

Author:
uudashr

Constructor Summary
RelativeTimeFormatter()
          Construct with default timezone.
RelativeTimeFormatter(java.util.TimeZone timezone)
          Construct with specified SMSC timezone.
 
Method Summary
 java.lang.String format(java.util.Calendar calendar)
          Format the date to String representation.
 java.lang.String format(java.util.Date date)
          Format the date to String representation.
static java.lang.String format(java.lang.Integer year, java.lang.Integer month, java.lang.Integer day, java.lang.Integer hour, java.lang.Integer minute, java.lang.Integer second)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelativeTimeFormatter

public RelativeTimeFormatter()
Construct with default timezone.


RelativeTimeFormatter

public RelativeTimeFormatter(java.util.TimeZone timezone)
Construct with specified SMSC timezone.

Parameters:
timezone - is the SMSC timezone.
Method Detail

format

public java.lang.String format(java.util.Calendar calendar)
Description copied from interface: TimeFormatter
Format the date to String representation.

Specified by:
format in interface TimeFormatter
Parameters:
calendar - is the calendar to format.
Returns:
the formatted date or null if the date is null.

format

public java.lang.String format(java.util.Date date)
Description copied from interface: TimeFormatter
Format the date to String representation.

Specified by:
format in interface TimeFormatter
Parameters:
date - is the date to format.
Returns:
the formatted date or null if the date is null.

format

public static final java.lang.String format(java.lang.Integer year,
                                            java.lang.Integer month,
                                            java.lang.Integer day,
                                            java.lang.Integer hour,
                                            java.lang.Integer minute,
                                            java.lang.Integer second)