org.openstreetmap.osmosis.core.domain.common
Class TimestampFormat

java.lang.Object
  extended by org.openstreetmap.osmosis.core.domain.common.TimestampFormat
Direct Known Subclasses:
XmlTimestampFormat

public abstract class TimestampFormat
extends java.lang.Object

Concrete implementations of this class support dates in a specific format. This is used for the lazy timestamp parsing functionality whereby dates can be passed through the entire pipeline in unparsed string form if both ends use the same date format.

Note that all methods within this class must be threadsafe because it may be utilised concurrently at many points throughout a processing pipeline.

Author:
Brett Henderson

Constructor Summary
TimestampFormat()
           
 
Method Summary
abstract  java.lang.String formatTimestamp(java.util.Date timestamp)
          Formats the date object into string form.
 boolean isEquivalent(TimestampFormat timestampFormat)
          Indicates if the specified date format object supports the same date format as this object.
abstract  java.util.Date parseTimestamp(java.lang.String timestamp)
          Parses a date string into date form.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimestampFormat

public TimestampFormat()
Method Detail

formatTimestamp

public abstract java.lang.String formatTimestamp(java.util.Date timestamp)
Formats the date object into string form.

Parameters:
timestamp - The date to be formatted.
Returns:
The formatted date string.

parseTimestamp

public abstract java.util.Date parseTimestamp(java.lang.String timestamp)
Parses a date string into date form.

Parameters:
timestamp - The date string to be parsed.
Returns:
The date object.

isEquivalent

public boolean isEquivalent(TimestampFormat timestampFormat)
Indicates if the specified date format object supports the same date format as this object.

Parameters:
timestampFormat - The date format to compare against.
Returns:
True if the date format is equivalent between the two date objects.