net.fortuna.ical4j.model
Class TimeZoneRegistryImpl

java.lang.Object
  extended bynet.fortuna.ical4j.model.TimeZoneRegistryImpl
All Implemented Interfaces:
TimeZoneRegistry

public class TimeZoneRegistryImpl
extends Object
implements TimeZoneRegistry

The default implementation of a TimeZoneRegistry. This implementation will search the classpath for applicable VTimeZone definitions used to back the provided TimeZone instances.

Author:
Ben Fortuna

Constructor Summary
TimeZoneRegistryImpl()
          Default constructor.
TimeZoneRegistryImpl(String resourcePrefix)
          Creates a new instance using the specified resource prefix.
 
Method Summary
 void clear()
          Clears all registered timezones.
 TimeZone getTimeZone(String id)
          Returns a timezone with the specified identifier.
 void register(TimeZone timezone)
          Registers a new timezone for use with iCalendar objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeZoneRegistryImpl

public TimeZoneRegistryImpl()
Default constructor.


TimeZoneRegistryImpl

public TimeZoneRegistryImpl(String resourcePrefix)
Creates a new instance using the specified resource prefix.

Parameters:
resourcePrefix - a prefix prepended to classpath resource lookups for default timezones
Method Detail

register

public final void register(TimeZone timezone)
Description copied from interface: TimeZoneRegistry
Registers a new timezone for use with iCalendar objects. If a timezone with the same identifier is already registered this timezone will take precedence.

Specified by:
register in interface TimeZoneRegistry
Parameters:
timezone - a timezone to be registered for use with iCalendar objects

clear

public final void clear()
Description copied from interface: TimeZoneRegistry
Clears all registered timezones.

Specified by:
clear in interface TimeZoneRegistry

getTimeZone

public final TimeZone getTimeZone(String id)
Description copied from interface: TimeZoneRegistry
Returns a timezone with the specified identifier.

Specified by:
getTimeZone in interface TimeZoneRegistry
Parameters:
id - a timezone identifier
Returns:
a timezone matching the specified identifier. If no timezone is registered with the specified identifier null is returned.