gov.nasa.pds.tools.label
Class DateTimeFormatter

java.lang.Object
  extended by gov.nasa.pds.tools.label.DateTimeFormatter

public class DateTimeFormatter
extends Object

Implements a parser for a PDS3 date/time string.

Version:
$Revision: 8410 $
Author:
pramirez, jagander, merose

Constructor Summary
DateTimeFormatter()
           
 
Method Summary
static Date lenientParse(Label label, String dateTime, int lineNumber)
           
static Date parse(Label label, String dateTime, int lineNumber)
          Parses a date/time string into a Java Date.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateTimeFormatter

public DateTimeFormatter()
Method Detail

parse

public static Date parse(Label label,
                         String dateTime,
                         int lineNumber)
                  throws LabelParserException
Parses a date/time string into a Java Date. Throws error exceptions with respect to a designated label, if there are parse errors.

Parameters:
label - the label in which the date/time string appears
dateTime - the date/time string from the label
lineNumber - the line number within the label where the date/time string appears
Returns:
the date corresponding to the date/time string
Throws:
LabelParserException - if there are any parse errors

lenientParse

public static Date lenientParse(Label label,
                                String dateTime,
                                int lineNumber)
                         throws LabelParserException
Throws:
LabelParserException


Copyright © 2005-2011 Planetary Data System. All Rights Reserved.