nl.itc.RIMapper
Class WMSTime

java.lang.Object
  extended by nl.itc.RIMapper.WMSTime

public class WMSTime
extends Object

Author:
kobben

Field Summary
static String ISO_TIME_PATTERN
           
static String JAVA_TIME_PATTERN
           
static String SQL_TO_EPOCH
           
static String SQL_TO_TIMESTAMP
           
 
Constructor Summary
WMSTime(String theTimeStr)
          constructor: Analyses and picks aparts a TIME (ISO8601:1988(E)) parameter.
 
Method Summary
 String getFromDateTimeISO()
           
 long getFromEpochSecs()
           
 String getPeriodicityISO()
           
 String getTimeRequestISO()
           
 String getToDateTimeISO()
           
 long getToEpochSecs()
           
 boolean isTimeRequested()
           
static String seconds(String timeCol)
          Static Utility class to create SQL to convert ISO strings to seconds since Epoch
static String timestamp(String timeCol)
          Static Utility class to create SQL to convert ISO string to timestamp
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ISO_TIME_PATTERN

public static final String ISO_TIME_PATTERN
See Also:
Constant Field Values

JAVA_TIME_PATTERN

public static final String JAVA_TIME_PATTERN
See Also:
Constant Field Values

SQL_TO_TIMESTAMP

public static final String SQL_TO_TIMESTAMP
See Also:
Constant Field Values

SQL_TO_EPOCH

public static final String SQL_TO_EPOCH
See Also:
Constant Field Values
Constructor Detail

WMSTime

public WMSTime(String theTimeStr)
        throws RIMapperException
constructor: Analyses and picks aparts a TIME (ISO8601:1988(E)) parameter. Deals with single time instance ( 'datetime' ) OR contiguous time periods ( 'datetime_begin/datetime_end' ) Ignores periodicity for now: ('datetime_begin/datetime_end/Period') => last part is ignored and contiguous time period is returned

Throws:
RIMapperException
Method Detail

timestamp

public static String timestamp(String timeCol)
Static Utility class to create SQL to convert ISO string to timestamp

Parameters:
timeCol - an ISO8061 formatted column
Returns:
an SQL fragment

seconds

public static String seconds(String timeCol)
Static Utility class to create SQL to convert ISO strings to seconds since Epoch

Parameters:
timeCol - an ISO8061 formatted column
Returns:
an SQL fragment

isTimeRequested

public boolean isTimeRequested()
Returns:
the timeRequested

getTimeRequestISO

public String getTimeRequestISO()
Returns:
the timeRequestISO interpreted version of TIME field as used in DB query and forwarded to subsequent calls...

getFromDateTimeISO

public String getFromDateTimeISO()
Returns:
the fromDateTimeISO

getToDateTimeISO

public String getToDateTimeISO()
Returns:
the toDateTimeISO

getPeriodicityISO

public String getPeriodicityISO()
Returns:
the periodicityISO

getFromEpochSecs

public long getFromEpochSecs()
Returns:
the fromEpochSecs

getToEpochSecs

public long getToEpochSecs()
Returns:
the toEpochSecs