Overview | Package | Class | Tree | Deprecated | Index | Help
| Protégé-OWL 3.4 rc1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.stanford.smi.protegex.owl.swrl.bridge.builtins.temporal
Class Temporal

    java.lang.Object
      edu.stanford.smi.protegex.owl.swrl.bridge.builtins.temporal.Temporal

    public class Temporal

extends Object

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

### MILLISECONDS

    public static final int MILLISECONDS

See Also:
  Constant Field Values

### SECONDS

    public static final int SECONDS

See Also:
  Constant Field Values

### MINUTES

    public static final int MINUTES

See Also:
  Constant Field Values

### HOURS

    public static final int HOURS

See Also:
  Constant Field Values

### DAYS

    public static final int DAYS

See Also:
  Constant Field Values

### MONTHS

    public static final int MONTHS

See Also:
  Constant Field Values

### YEARS

    public static final int YEARS

See Also:
  Constant Field Values

### FINEST

    public static final int FINEST

See Also:
  Constant Field Values

### COARSEST

    public static final int COARSEST

See Also:
  Constant Field Values

### NUMBER_OF_GRANULARITIES

    public static final int NUMBER_OF_GRANULARITIES

See Also:
  Constant Field Values

### millisecondsTo1970

    public static final long millisecondsTo1970

See Also:
  Constant Field Values

### millisecondsToGregorianChangeDate

    public static final long millisecondsToGregorianChangeDate

See Also:
  Constant Field Values

### millisecondsInGregorianDiscontinuity

    public static final long millisecondsInGregorianDiscontinuity

See Also:
  Constant Field Values

Constructor Detail

### Temporal

    public Temporal(DatetimeStringProcessor _datetimeStringProcessor)

Method Detail

### setNow

    public void setNow(String nowDatetimeString)
                throws TemporalException

  Throws:
    `TemporalException`

### setNow

    public void setNow()
                throws TemporalException

  Throws:
    `TemporalException`

### checkGranularity

    public void checkGranularity(String granularity)
                          throws TemporalException

  Throws:
    `TemporalException`

### checkMonthCount

    public static void checkMonthCount(long monthCount)
                                throws TemporalException

  Throws:
    `TemporalException`

### getIntegerGranularityRepresentation

    public static int getIntegerGranularityRepresentation(String granularity)
                                                   throws TemporalException

  Throws:
    `TemporalException`

### isValidGranularityString

    public static boolean isValidGranularityString(String granularity)

### getStringGranularityRepresentation

    public static String getStringGranularityRepresentation(int granularity)
                                                     throws TemporalException

  Throws:
    `TemporalException`

### granuleCount2Timestamp

    public static Timestamp granuleCount2Timestamp(long granuleCount,
                                                   int granularity)
                                            throws TemporalException

  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. Java Timestamps record time as milliseconds from January 1st 1970.

  Throws:
    `TemporalException`

### timestamp2GranuleCount

    public long timestamp2GranuleCount(Timestamp timestamp,
                                       int granularity)
                                throws TemporalException

  Take a timestamp and return the number of granules at the specified granularity since 1 C.E.

  Throws:
    `TemporalException`

### datetimeString2GranuleCount

    public long datetimeString2GranuleCount(String datetimeString,
                                            int granularity)
                                     throws TemporalException

  Take a full specification datetime and return the number of granules at the specified granularity since 1 C.E.

  Throws:
    `TemporalException`

### convertGranuleCount

    public static long convertGranuleCount(long granuleCount,
                                           int from_granularity,
                                           int to_granularity)
                                    throws TemporalException

  Convert a granule count from one granularity to another.

  Throws:
    `TemporalException`

### getDaysInMonth

    public static int getDaysInMonth(long monthCount)
                              throws TemporalException

  Throws:
    `TemporalException`

### isLeapYear

    public static boolean isLeapYear(long yearCount)

### convertGranuleCount2MonthCount

    public static long convertGranuleCount2MonthCount(long granuleCount,
                                                      int from_granularity)
                                               throws TemporalException

  Throws:
    `TemporalException`

### sqlDate2UtilDate

    public static Date sqlDate2UtilDate(Date sqlDate,
                                        int granularity)
                                 throws TemporalException

  Throws:
    `TemporalException`

### sqlDate2UtilDate

    public static Date sqlDate2UtilDate(Date sqlDate)
                                 throws TemporalException

  Throws:
    `TemporalException`

### sqlDate2GranuleCount

    public static long sqlDate2GranuleCount(Date date,
                                            int granularity)
                                     throws TemporalException

  Throws:
    `TemporalException`

### utilDate2GranuleCount

    public static long utilDate2GranuleCount(Date date,
                                             int granularity)
                                      throws TemporalException

  Throws:
    `TemporalException`

### utilDate2SQLDate

    public Date utilDate2SQLDate(Date date)
                          throws TemporalException

  Throws:
    `TemporalException`

### addGranuleCount

    public static Date addGranuleCount(Date date,
                                       long granuleCount,
                                       int granularity)
                                throws TemporalException

  Throws:
    `TemporalException`

### subtractGranuleCount

    public static Date subtractGranuleCount(Date date,
                                            long granuleCount,
                                            int granularity)
                                     throws TemporalException

  Throws:
    `TemporalException`

### getNowSQLDate

    public Date getNowSQLDate()
                       throws TemporalException

  Throws:
    `TemporalException`

### getNowUtilDate

    public Date getNowUtilDate()
                        throws TemporalException

  Throws:
    `TemporalException`

### getNowGranuleCount

    public long getNowGranuleCount(int granularity)
                            throws TemporalException

  Throws:
    `TemporalException`

### granuleCount2UtilDate

    public static Date granuleCount2UtilDate(long granuleCount,
                                             int granularity)
                                      throws TemporalException

  Throws:
    `TemporalException`

### granuleCount2SQLDate

    public static Date granuleCount2SQLDate(long granuleCount,
                                            int granularity)
                                     throws TemporalException

  Throws:
    `TemporalException`

### getNowDatetimeString

    public String getNowDatetimeString()
                                throws TemporalException

  Throws:
    `TemporalException`

### normalizeDatetimeString

    public String normalizeDatetimeString(String datetimeString,
                                          int granularity,
                                          boolean roundUp)
                                   throws TemporalException

  Throws:
    `TemporalException`

### normalizeDatetimeString

    public String normalizeDatetimeString(String datetimeString,
                                          int granularity)
                                   throws TemporalException

  Throws:
    `TemporalException`

### stripDatetimeString

    public String stripDatetimeString(String datetimeString,
                                      int granularity)
                               throws TemporalException

  Throws:
    `TemporalException`

### expressDatetimeStringAtGranularity

    public String expressDatetimeStringAtGranularity(String datetimeString,
                                                     int granularity,
                                                     boolean roundUp)
                                              throws TemporalException

  Throws:
    `TemporalException`

### expressDatetimeStringAtGranularity

    public String expressDatetimeStringAtGranularity(String datetimeString,
                                                     int granularity)
                                              throws TemporalException

  Throws:
    `TemporalException`

### sqlDate2DatetimeString

    public String sqlDate2DatetimeString(Date date,
                                         int granularity)
                                  throws TemporalException

  Throws:
    `TemporalException`

### sqlDate2DatetimeString

    public String sqlDate2DatetimeString(Date date)
                                  throws TemporalException

  Throws:
    `TemporalException`

### utilDate2DatetimeString

    public String utilDate2DatetimeString(Date date,
                                          int granularity)
                                   throws TemporalException

  Throws:
    `TemporalException`

### utilDate2DatetimeString

    public String utilDate2DatetimeString(Date date)
                                   throws TemporalException

  Throws:
    `TemporalException`

### datetimeString2SQLDate

    public Date datetimeString2SQLDate(String datetimeString,
                                       int granularity)
                                throws TemporalException

  Throws:
    `TemporalException`

### datetimeString2SQLDate

    public Date datetimeString2SQLDate(String datetimeString)
                                throws TemporalException

  Throws:
    `TemporalException`

### datetimeString2UtilDate

    public Date datetimeString2UtilDate(String datetimeString,
                                        int granularity)
                                 throws TemporalException

  Throws:
    `TemporalException`

### datetimeString2UtilDate

    public Date datetimeString2UtilDate(String datetimeString)
                                 throws TemporalException

  Throws:
    `TemporalException`

### addGranuleCount

    public String addGranuleCount(String datetimeString,
                                  long granuleCount,
                                  int granularity)
                           throws TemporalException

  Throws:
    `TemporalException`

### subtractGranuleCount

    public String subtractGranuleCount(String datetimeString,
                                       long granuleCount,
                                       int granularity)
                                throws TemporalException

  Throws:
    `TemporalException`

### granuleCount2DatetimeString

    public String granuleCount2DatetimeString(long granuleCount,
                                              int granularity)
                                       throws TemporalException

  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.

  Throws:
    `TemporalException`

### checkGranularity

    public static void checkGranularity(int granularity)
                                 throws TemporalException

  Throws:
    `TemporalException`

### throwInvalidDatetimeStringException

    public static void throwInvalidDatetimeStringException(String datetimeString)
                                                    throws TemporalException

  Throws:
    `TemporalException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Protégé-OWL 3.4 rc1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Submit a bug report or feature request
Copyright (c) 1998-2009 Stanford University.