|
Protégé-OWL 3.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.smi.protegex.owl.swrl.bridge.builtins.temporal.Temporal
public class Temporal
A class that supports temporal operations using the Gregorian calendar. In instance of this class is supplied with a DatetimeStringProcessor that governs how timestamps are converted to and from datetime strings. Apart from the granularity constants, users should generally not use this class directly but should instead use the Instant and Period classes in this package.
Field Summary | |
---|---|
static int |
COARSEST
|
static int |
DAYS
|
static int |
FINEST
|
static int |
HOURS
|
static int |
MILLISECONDS
|
static long |
millisecondsInGregorianDiscontinuity
|
static long |
millisecondsTo1970
|
static long |
millisecondsToGregorianChangeDate
|
static int |
MINUTES
|
static int |
MONTHS
|
static int |
NUMBER_OF_GRANULARITIES
|
static int |
SECONDS
|
static int |
YEARS
|
Constructor Summary | |
---|---|
Temporal(DatetimeStringProcessor _datetimeStringProcessor)
|
Method Summary | |
---|---|
static Date |
addGranuleCount(Date date,
long granuleCount,
int granularity)
|
String |
addGranuleCount(String datetimeString,
long granuleCount,
int granularity)
|
static void |
checkGranularity(int granularity)
|
void |
checkGranularity(String granularity)
|
static void |
checkMonthCount(long monthCount)
|
static long |
convertGranuleCount(long granuleCount,
int from_granularity,
int to_granularity)
Convert a granule count from one granularity to another. |
static long |
convertGranuleCount2MonthCount(long granuleCount,
int from_granularity)
|
long |
datetimeString2GranuleCount(String datetimeString,
int granularity)
Take a full specification datetime and return the number of granules at the specified granularity since 1 C.E. |
Date |
datetimeString2SQLDate(String datetimeString)
|
Date |
datetimeString2SQLDate(String datetimeString,
int granularity)
|
Date |
datetimeString2UtilDate(String datetimeString)
|
Date |
datetimeString2UtilDate(String datetimeString,
int granularity)
|
String |
expressDatetimeStringAtGranularity(String datetimeString,
int granularity)
|
String |
expressDatetimeStringAtGranularity(String datetimeString,
int granularity,
boolean roundUp)
|
static int |
getDaysInMonth(long monthCount)
|
static int |
getIntegerGranularityRepresentation(String granularity)
|
String |
getNowDatetimeString()
|
long |
getNowGranuleCount(int granularity)
|
Date |
getNowSQLDate()
|
Date |
getNowUtilDate()
|
static String |
getStringGranularityRepresentation(int granularity)
|
String |
granuleCount2DatetimeString(long granuleCount,
int granularity)
Take a granule count (from the beginning of calendar time, i.e., January 1st 1 C.E) at any granularity and convert it to a datetime string. |
static Date |
granuleCount2SQLDate(long granuleCount,
int granularity)
|
static Timestamp |
granuleCount2Timestamp(long granuleCount,
int granularity)
Take a granule count (from the beginning of calendar time, i.e., '0000-01-01 00:00:00.000' in JDBC timestamp format) at any granularity and convert it to a Timestamp. |
static Date |
granuleCount2UtilDate(long granuleCount,
int granularity)
|
static boolean |
isLeapYear(long yearCount)
|
static boolean |
isValidGranularityString(String granularity)
|
String |
normalizeDatetimeString(String datetimeString,
int granularity)
|
String |
normalizeDatetimeString(String datetimeString,
int granularity,
boolean roundUp)
|
void |
setNow()
|
void |
setNow(String nowDatetimeString)
|
String |
sqlDate2DatetimeString(Date date)
|
String |
sqlDate2DatetimeString(Date date,
int granularity)
|
static long |
sqlDate2GranuleCount(Date date,
int granularity)
|
static Date |
sqlDate2UtilDate(Date sqlDate)
|
static Date |
sqlDate2UtilDate(Date sqlDate,
int granularity)
|
String |
stripDatetimeString(String datetimeString,
int granularity)
|
static Date |
subtractGranuleCount(Date date,
long granuleCount,
int granularity)
|
String |
subtractGranuleCount(String datetimeString,
long granuleCount,
int granularity)
|
static void |
throwInvalidDatetimeStringException(String datetimeString)
|
long |
timestamp2GranuleCount(Timestamp timestamp,
int granularity)
Take a timestamp and return the number of granules at the specified granularity since 1 C.E. |
String |
utilDate2DatetimeString(Date date)
|
String |
utilDate2DatetimeString(Date date,
int granularity)
|
static long |
utilDate2GranuleCount(Date date,
int granularity)
|
Date |
utilDate2SQLDate(Date date)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MILLISECONDS
public static final int SECONDS
public static final int MINUTES
public static final int HOURS
public static final int DAYS
public static final int MONTHS
public static final int YEARS
public static final int FINEST
public static final int COARSEST
public static final int NUMBER_OF_GRANULARITIES
public static final long millisecondsTo1970
public static final long millisecondsToGregorianChangeDate
public static final long millisecondsInGregorianDiscontinuity
Constructor Detail |
---|
public Temporal(DatetimeStringProcessor _datetimeStringProcessor)
Method Detail |
---|
public void setNow(String nowDatetimeString) throws TemporalException
TemporalException
public void setNow() throws TemporalException
TemporalException
public void checkGranularity(String granularity) throws TemporalException
TemporalException
public static void checkMonthCount(long monthCount) throws TemporalException
TemporalException
public static int getIntegerGranularityRepresentation(String granularity) throws TemporalException
TemporalException
public static boolean isValidGranularityString(String granularity)
public static String getStringGranularityRepresentation(int granularity) throws TemporalException
TemporalException
public static Timestamp granuleCount2Timestamp(long granuleCount, int granularity) throws TemporalException
TemporalException
public long timestamp2GranuleCount(Timestamp timestamp, int granularity) throws TemporalException
TemporalException
public long datetimeString2GranuleCount(String datetimeString, int granularity) throws TemporalException
TemporalException
public static long convertGranuleCount(long granuleCount, int from_granularity, int to_granularity) throws TemporalException
TemporalException
public static int getDaysInMonth(long monthCount) throws TemporalException
TemporalException
public static boolean isLeapYear(long yearCount)
public static long convertGranuleCount2MonthCount(long granuleCount, int from_granularity) throws TemporalException
TemporalException
public static Date sqlDate2UtilDate(Date sqlDate, int granularity) throws TemporalException
TemporalException
public static Date sqlDate2UtilDate(Date sqlDate) throws TemporalException
TemporalException
public static long sqlDate2GranuleCount(Date date, int granularity) throws TemporalException
TemporalException
public static long utilDate2GranuleCount(Date date, int granularity) throws TemporalException
TemporalException
public Date utilDate2SQLDate(Date date) throws TemporalException
TemporalException
public static Date addGranuleCount(Date date, long granuleCount, int granularity) throws TemporalException
TemporalException
public static Date subtractGranuleCount(Date date, long granuleCount, int granularity) throws TemporalException
TemporalException
public Date getNowSQLDate() throws TemporalException
TemporalException
public Date getNowUtilDate() throws TemporalException
TemporalException
public long getNowGranuleCount(int granularity) throws TemporalException
TemporalException
public static Date granuleCount2UtilDate(long granuleCount, int granularity) throws TemporalException
TemporalException
public static Date granuleCount2SQLDate(long granuleCount, int granularity) throws TemporalException
TemporalException
public String getNowDatetimeString() throws TemporalException
TemporalException
public String normalizeDatetimeString(String datetimeString, int granularity, boolean roundUp) throws TemporalException
TemporalException
public String normalizeDatetimeString(String datetimeString, int granularity) throws TemporalException
TemporalException
public String stripDatetimeString(String datetimeString, int granularity) throws TemporalException
TemporalException
public String expressDatetimeStringAtGranularity(String datetimeString, int granularity, boolean roundUp) throws TemporalException
TemporalException
public String expressDatetimeStringAtGranularity(String datetimeString, int granularity) throws TemporalException
TemporalException
public String sqlDate2DatetimeString(Date date, int granularity) throws TemporalException
TemporalException
public String sqlDate2DatetimeString(Date date) throws TemporalException
TemporalException
public String utilDate2DatetimeString(Date date, int granularity) throws TemporalException
TemporalException
public String utilDate2DatetimeString(Date date) throws TemporalException
TemporalException
public Date datetimeString2SQLDate(String datetimeString, int granularity) throws TemporalException
TemporalException
public Date datetimeString2SQLDate(String datetimeString) throws TemporalException
TemporalException
public Date datetimeString2UtilDate(String datetimeString, int granularity) throws TemporalException
TemporalException
public Date datetimeString2UtilDate(String datetimeString) throws TemporalException
TemporalException
public String addGranuleCount(String datetimeString, long granuleCount, int granularity) throws TemporalException
TemporalException
public String subtractGranuleCount(String datetimeString, long granuleCount, int granularity) throws TemporalException
TemporalException
public String granuleCount2DatetimeString(long granuleCount, int granularity) throws TemporalException
TemporalException
public static void checkGranularity(int granularity) throws TemporalException
TemporalException
public static void throwInvalidDatetimeStringException(String datetimeString) throws TemporalException
TemporalException
|
Protégé-OWL 3.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |