|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectits.backbone.domain.SerialNumber
Produces time in serial number format: yyyymmddhhmmsssss There's no need to instantiate this class; it only provides static methods.
| Constructor Summary | |
SerialNumber()
|
|
| Method Summary | |
static int |
compareTo(java.lang.String sn1,
java.lang.String sn2)
compares two serial numbers |
static int |
getDate(java.lang.String sn)
gets serial number day |
static java.util.Date |
getDateObject(java.lang.String sn)
converts given serial number string to a Date object |
static int |
getHour(java.lang.String sn)
gets serial number hour |
static int |
getMillisecond(java.lang.String sn)
gets serial number millisecond |
static long |
getMillisecondsFromEpoch(java.lang.String sn)
Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this SerialNumber. |
static int |
getMinute(java.lang.String sn)
gets serial number minute |
static int |
getMinutesAfterMidnight(java.lang.String timeVal)
Return the number of minutes after midnight (ranges from 0 to 1439) |
static int |
getMonth(java.lang.String sn)
gets serial number month |
static int |
getSecond(java.lang.String sn)
gets serial number second |
static java.lang.String |
getSerialNumber()
gets serial number from current time |
static java.lang.String |
getSerialNumber(byte[] data)
gets the serial number from the first four bytes of a data block, assuming UNIX format |
static java.lang.String |
getSerialNumber(java.util.Date date)
gets serial number from the given Date object |
static java.lang.String |
getSerialNumber(int year,
int month,
int date,
int hr,
int min,
int sec,
int ms)
getSerialNumber: builds a serial number string. |
static java.lang.String |
getTimeFormat(java.lang.String sn,
java.text.SimpleDateFormat sdf)
converts serial number string to the given format |
static int |
getYear(java.lang.String sn)
gets serial number year |
static boolean |
isValid(java.lang.String sn)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SerialNumber()
| Method Detail |
public static java.lang.String getSerialNumber()
public static java.lang.String getSerialNumber(java.util.Date date)
public static java.lang.String getSerialNumber(byte[] data)
throws java.lang.IllegalArgumentException
data - a byte[] array of binary data
java.lang.IllegalArgumentException - thrown if bad data length
public static java.lang.String getSerialNumber(int year,
int month,
int date,
int hr,
int min,
int sec,
int ms)
throws java.lang.IllegalArgumentException
year - the year >= 1997month - the month (January is 1, through December 12)date - the date of the month 1-31hr - the hour of day 0-23 (in GMT, +8 hrs pst, +7 hrs pdt)min - the minute of the hour 0-59sec - the second of the minute 0-59ms - the milliseconds 0-999
java.lang.IllegalArgumentException - thrown if parameter out of rangepublic static int getYear(java.lang.String sn)
public static int getMonth(java.lang.String sn)
public static int getDate(java.lang.String sn)
public static int getHour(java.lang.String sn)
public static int getMinute(java.lang.String sn)
public static int getSecond(java.lang.String sn)
public static int getMillisecond(java.lang.String sn)
public static java.util.Date getDateObject(java.lang.String sn)
throws java.lang.IllegalArgumentException
sn - the original serial number
java.lang.IllegalArgumentException - thrown for invalid snpublic static long getMillisecondsFromEpoch(java.lang.String sn)
sn - the original serial number
java.lang.IllegalArgumentException - thrown for invalid sn
public static java.lang.String getTimeFormat(java.lang.String sn,
java.text.SimpleDateFormat sdf)
sn - serial number String
java.lang.IllegalArgumentException - thrown if sn bad
public static int compareTo(java.lang.String sn1,
java.lang.String sn2)
throws java.lang.IllegalArgumentException
sn1 - the first snsn2 - the second sn
java.lang.IllegalArgumentException - thrown for bad snpublic static boolean isValid(java.lang.String sn)
public static int getMinutesAfterMidnight(java.lang.String timeVal)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||