MDateSelector

mseries.ui
Class MDateFormatter

java.lang.Object
  extended by mseries.ui.MDateFormatter
All Implemented Interfaces:
MDateFormat

public class MDateFormatter
extends Object
implements MDateFormat


Method Summary
 Date dateParse(String text)
          Uses Date formatters to parse the input text
 Date dateTimeParse(String text)
          Uses DateTime formatters to parse the input text
 String format(Date date)
          Returns the date formatted for display in the form of a String.
 StringBuffer format(Date date, StringBuffer appendTo, FieldPosition pos)
           
static MDateFormat getInstance()
          Singleton constructor, there is no public constructor for this class
static void main(String[] args)
           
 Date parse(String text)
          Applies the formatters to parse the input string and attempts to translate it into a valid date.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static MDateFormat getInstance()
Singleton constructor, there is no public constructor for this class


format

public String format(Date date)
Returns the date formatted for display in the form of a String. The format is defined in the constructor of the class.

Specified by:
format in interface MDateFormat

format

public StringBuffer format(Date date,
                           StringBuffer appendTo,
                           FieldPosition pos)
Specified by:
format in interface MDateFormat

parse

public Date parse(String text)
           throws ParseException
Applies the formatters to parse the input string and attempts to translate it into a valid date. Valid dates with the last two digits less than the value of Constants.CENTURY_VALUE are parsed to the 21st Century, greater than the constant value are the 20th Century.

Specified by:
parse in interface MDateFormat
Throws:
ParseException

dateParse

public Date dateParse(String text)
               throws ParseException
Uses Date formatters to parse the input text

Parameters:
text - - the string to be parsed
Throws:
ParseException

dateTimeParse

public Date dateTimeParse(String text)
                   throws ParseException
Uses DateTime formatters to parse the input text

Parameters:
text - - the string to be parsed
Throws:
ParseException

main

public static void main(String[] args)

MDateSelector

Copyright © 2001-2007 M Newstead. All Rights Reserved.