NumberDateFormat (Lucene 10.5.0 queryparser API)
Description: declaration: package: org.apache.lucene.queryparser.flexible.standard.config, class: NumberDateFormat

Package org.apache.lucene.queryparser.flexible.standard.config

# Class NumberDateFormat

java.lang.Object
java.text.Format
java.text.NumberFormat
org.apache.lucene.queryparser.flexible.standard.config.NumberDateFormat

All Implemented Interfaces:
  `Serializable`, `Cloneable`

public class NumberDateFormat extends 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

  `NumberFormat.Field, NumberFormat.Style`

- ## Field Summary

  ### Fields inherited from class java.text.NumberFormat

  `FRACTION_FIELD, INTEGER_FIELD`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NumberDateFormat(DateFormat dateFormat)`
  Constructs a `NumberDateFormat` object using the given `DateFormat`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `StringBuffer`
  `format(double number, StringBuffer toAppendTo, FieldPosition pos)`
  `StringBuffer`
  `format(long number, StringBuffer toAppendTo, FieldPosition pos)`
  `StringBuffer`
  `format(Object number, StringBuffer toAppendTo, FieldPosition pos)`
  `Number`
  `parse(String source, ParsePosition parsePosition)`

  ### Methods inherited from class java.text.NumberFormat

  `clone, equals, format, format, getAvailableLocales, getCompactNumberInstance, getCompactNumberInstance, 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

  `finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### NumberDateFormat

    public NumberDateFormat(DateFormat dateFormat)
    Constructs a `NumberDateFormat` object using the given `DateFormat`.
    Parameters:
      `dateFormat` - `DateFormat` used to parse and format dates

- ## Method Details

  - ### format

    public StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition pos)
    Specified by:
      `format` in class `NumberFormat`

  - ### format

    public StringBuffer format(long number, StringBuffer toAppendTo, FieldPosition pos)
    Specified by:
      `format` in class `NumberFormat`

  - ### parse

    public Number parse(String source, ParsePosition parsePosition)
    Specified by:
      `parse` in class `NumberFormat`

  - ### format

    public StringBuffer format(Object number, StringBuffer toAppendTo, FieldPosition pos)
    Overrides:
      `format` in class `NumberFormat`