|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mobicents.protocols.smpp.util.SMPPDate
public abstract class SMPPDate
Object to represent an SMPP time specification. There are two types of SMPP time specs: an absolute time and a relative time. Absolute times specify the exact year, month, day, hour, minute, second, tenths of a second and timezone. Relative times specify an offset of years, months, days, hours, minutes and seconds from the current time. Both types of time formats take the same string form "YYMMDDhhmmss[tnnp]", where
SMPPDateFormat class.See section 7.1 of the SMPP v3.4 specification for the official definition of SMPP time formats.
SMPPDateFormat,
Serialized Form| Constructor Summary | |
|---|---|
protected |
SMPPDate()
|
| Method Summary | |
|---|---|
static SMPPDate |
getAbsoluteInstance(Calendar calendar)
Get a date object representing an absolute time, as represented by the supplied calendar. |
static SMPPDate |
getAbsoluteInstance(Calendar calendar,
boolean withTz)
Get a date object representing an absolute time, as represented by the supplied calendar. |
Calendar |
getCalendar()
Get a calendar object that represents the time specified by this SMPPDate. |
abstract int |
getDay()
Get the day part of this time format. |
abstract int |
getHour()
Get the hour part of this time format. |
int |
getLength()
Return the length this SMPP date would encode as. |
abstract int |
getMinute()
Get the minute part of this time format. |
abstract int |
getMonth()
Get the month part of this time format. |
static SMPPDate |
getRelativeInstance(int years,
int months,
int days,
int hours,
int minutes,
int seconds)
Get a date object representing a relative time. |
abstract int |
getSecond()
Get the second part of this time format. |
char |
getSign()
Get the timezone offset modifier character. |
int |
getTenth()
Get the tenths of a second part of this time format. |
TimeZone |
getTimeZone()
Get the timezone of this SMPPDate. |
int |
getUtcOffset()
Get the UTC offset part of this time format. |
abstract int |
getYear()
Get the year part of this time format. |
boolean |
hasTimezone()
Determine if this date object has timezone information associated with it. |
boolean |
isAbsolute()
Determine if this date object represents an absolute time. |
boolean |
isRelative()
Determine if this date object represents a relative time. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected SMPPDate()
| Method Detail |
|---|
public static SMPPDate getAbsoluteInstance(Calendar calendar)
calendar. This is the same as calling
SMPPDate.getAbsoluteInstance(calendar, true);.
calendar - A java.util.Calendar instance representing
the desired date, time and timezone for the SMPP time.
calendar.
public static SMPPDate getAbsoluteInstance(Calendar calendar,
boolean withTz)
calendar. The returned object will either
use or ignore the timezone information in the calendar object,
depending on whether withTz is true or
false.
calendar - A java.util.Calendar instance representing
the desired date, time and timezone for the SMPP time.withTz - true to return an object that uses the
timezone information specified in the calendar object, false
to return an SMPPDate that does not contain any timezone information.
calendar.
public static SMPPDate getRelativeInstance(int years,
int months,
int days,
int hours,
int minutes,
int seconds)
years - The number of years.months - The number of months.days - The number of days.hours - The number of hours.minutes - The number of minutes.seconds - The number of seconds.
public Calendar getCalendar()
null for relative
SMPP times. Also, for absolute SMPP times that do not contain timezone
information, the returned calendar's timezone cannot be trusted -
it will simply be initialised to whatever java.util.Calendar
considers its default (usually the timezone of the JVM).
null if this is a
relative time specification.public abstract int getYear()
2007) for absolute times.
public abstract int getMonth()
public abstract int getDay()
public abstract int getHour()
public abstract int getMinute()
public abstract int getSecond()
public int getTenth()
public int getUtcOffset()
getSign().
getTimeZone()public TimeZone getTimeZone()
null if
there is no timezone.public char getSign()
(char) 0 if
there is no timezone information.
(char) 0.public boolean isAbsolute()
true if this object is an absolute time,
false otherwise.public boolean isRelative()
true if this object is a relative time,
false otherwise.public boolean hasTimezone()
true if this date object "knows" its timezone,
false if it does not.public int getLength()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||