Esri Geoportal Server
1.2.9

com.esri.gpt.catalog.schema.indexable.tp
Class TpUtil

java.lang.Object
  extended by com.esri.gpt.catalog.schema.indexable.tp.TpUtil

public class TpUtil
extends Object

Timeperiod utilities.


Constructor Summary
TpUtil()
          Default constructor.
 
Method Summary
static void advanceToUpperBoundary(Calendar calendar, String date)
          Advances a calendar to the end of date interval.
static Calendar parseIsoDate(String lexicalDate)
          Parses an ISO 8601 date string.
static Calendar parseIsoDateTime(String lexicalDateTime)
          Parses an ISO 8601 date-time string.
static String printIsoDate(Calendar calendar)
          Converts a Calendar value into an ISO 8601 date string.
static String printIsoDateTime(Calendar calendar)
          Converts a Calendar value into an ISO 8601 date-time string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TpUtil

public TpUtil()
Default constructor.

Method Detail

advanceToUpperBoundary

public static void advanceToUpperBoundary(Calendar calendar,
                                          String date)
Advances a calendar to the end of date interval.

Example:
A calendar has been previously set to the beginning millisecond of 2010-04
Calling this method will advance the calendar to the final millisecond of 2010-04

Parameters:
calendar - the calendar to advance
date - the date string associated with the current calendar time

parseIsoDate

public static Calendar parseIsoDate(String lexicalDate)
Parses an ISO 8601 date string.
JAXB is used as the parser to provide a suitable ISO 8601 proxy.
See XML Schema Part 2: Datatypes for xsd:date.

Parameters:
lexicalDate - the lexical representation of the date
Returns:
a Calendar representing the input
Throws:
IllegalArgumentException - if the input does not conform
NullPointerException - if the input is null

parseIsoDateTime

public static Calendar parseIsoDateTime(String lexicalDateTime)
Parses an ISO 8601 date-time string.
JAXB is used as the parser to provide a suitable ISO 8601 proxy.
See XML Schema Part 2: Datatypes for xsd:dateTime.

Parameters:
lexicalDateTime - the lexical representation of the date-time
Returns:
a Calendar representing the input
Throws:
IllegalArgumentException - if the input does not conform
NullPointerException - if the input is null

printIsoDate

public static String printIsoDate(Calendar calendar)
Converts a Calendar value into an ISO 8601 date string.
JAXB is used to format the string.

Parameters:
calendar - the calendar value
Returns:
the formatted string

printIsoDateTime

public static String printIsoDateTime(Calendar calendar)
Converts a Calendar value into an ISO 8601 date-time string.
JAXB is used to format the string.

Parameters:
calendar - the calendar value
Returns:
the formatted string

Esri Geoportal Server
1.2.9

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.