com.askgeo.dbl.timezone
Class TimeZoneNameConverter

java.lang.Object
  extended by com.askgeo.dbl.timezone.TimeZoneNameConverter

public class TimeZoneNameConverter
extends java.lang.Object

Encodes the relationship between Olson time zone IDs and the Microsoft Windows time zone standard names.


Constructor Summary
TimeZoneNameConverter()
           
 
Method Summary
static java.lang.String[] getAllOlsonIds()
          Returns an array of all the Olson IDs understood by the converter.
static java.lang.String[] getAllWindowsStandardNames()
          Returns an array of all the Windows Standard Names that can be returned by the converter.
static java.lang.String getWindowsStandardNameFromOlsonId(java.lang.String olsonId)
          Converts from an Olson time zone ID of the sort returned by the TimeZoneMap class, to the Microsoft Windows time zone standard name.
static void loadData(java.io.InputStream dataFileStream)
          Reads a tab delimeted data file containing the mapping from Olson ID to Windows Standard Name.
static void printAll()
          Prints all the key value pairs in the converter.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeZoneNameConverter

public TimeZoneNameConverter()
Method Detail

loadData

public static void loadData(java.io.InputStream dataFileStream)
                     throws java.lang.Exception
Reads a tab delimeted data file containing the mapping from Olson ID to Windows Standard Name. The first field on each line is the Olson ID, followed by a tab, then followed by the corresponding Windows Standard Name.

Parameters:
dataFileStream - the stream from the data file to read.
Throws:
java.lang.Exception - if there is an IO exception when reading the stream

getWindowsStandardNameFromOlsonId

public static java.lang.String getWindowsStandardNameFromOlsonId(java.lang.String olsonId)
Converts from an Olson time zone ID of the sort returned by the TimeZoneMap class, to the Microsoft Windows time zone standard name.

Parameters:
olsonId - the Olson time zone ID.
Returns:
the Microsoft Windows time zone standard name.

getAllWindowsStandardNames

public static java.lang.String[] getAllWindowsStandardNames()
Returns an array of all the Windows Standard Names that can be returned by the converter.

Returns:
an array of all the Windows Standard Names.

getAllOlsonIds

public static java.lang.String[] getAllOlsonIds()
Returns an array of all the Olson IDs understood by the converter.

Returns:
an array of all the Olson IDs.

printAll

public static void printAll()
Prints all the key value pairs in the converter.



Copyright © 2012 Vector Magic, Inc.