Class NumberDateFormat

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class NumberDateFormat
    extends java.text.NumberFormat
    This Format parses Long into date strings and vice-versa. It uses the given DateFormat to parse and format dates, but before, it converts Long to Date objects or vice-versa.
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.text.NumberFormat

        java.text.NumberFormat.Field
    • Field Summary

      • Fields inherited from class java.text.NumberFormat

        FRACTION_FIELD, INTEGER_FIELD
    • Constructor Summary

      Constructors 
      Constructor Description
      NumberDateFormat​(java.text.DateFormat dateFormat)
      Constructs a NumberDateFormat object using the given DateFormat.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.StringBuffer format​(double number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)  
      java.lang.StringBuffer format​(long number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)  
      java.lang.StringBuffer format​(java.lang.Object number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)  
      java.lang.Number parse​(java.lang.String source, java.text.ParsePosition parsePosition)  
      • Methods inherited from class java.text.NumberFormat

        clone, equals, format, format, getAvailableLocales, getCurrency, getCurrencyInstance, getCurrencyInstance, getInstance, getInstance, getIntegerInstance, getIntegerInstance, getMaximumFractionDigits, getMaximumIntegerDigits, getMinimumFractionDigits, getMinimumIntegerDigits, getNumberInstance, getNumberInstance, getPercentInstance, getPercentInstance, getRoundingMode, hashCode, isGroupingUsed, isParseIntegerOnly, parse, parseObject, setCurrency, setGroupingUsed, setMaximumFractionDigits, setMaximumIntegerDigits, setMinimumFractionDigits, setMinimumIntegerDigits, setParseIntegerOnly, setRoundingMode
      • Methods inherited from class java.text.Format

        format, formatToCharacterIterator, parseObject
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NumberDateFormat

        public NumberDateFormat​(java.text.DateFormat dateFormat)
        Constructs a NumberDateFormat object using the given DateFormat.
        Parameters:
        dateFormat - DateFormat used to parse and format dates
    • Method Detail

      • format

        public java.lang.StringBuffer format​(double number,
                                             java.lang.StringBuffer toAppendTo,
                                             java.text.FieldPosition pos)
        Specified by:
        format in class java.text.NumberFormat
      • format

        public java.lang.StringBuffer format​(long number,
                                             java.lang.StringBuffer toAppendTo,
                                             java.text.FieldPosition pos)
        Specified by:
        format in class java.text.NumberFormat
      • parse

        public java.lang.Number parse​(java.lang.String source,
                                      java.text.ParsePosition parsePosition)
        Specified by:
        parse in class java.text.NumberFormat
      • format

        public java.lang.StringBuffer format​(java.lang.Object number,
                                             java.lang.StringBuffer toAppendTo,
                                             java.text.FieldPosition pos)
        Overrides:
        format in class java.text.NumberFormat