org.apache.solr.analytics.util.valuesource

## Class DateMathFunction

- java.lang.Object
- - org.apache.lucene.queries.function.ValueSource
  - - org.apache.solr.analytics.util.valuesource.MultiDateFunction
    - - org.apache.solr.analytics.util.valuesource.DateMathFunction

-     public class DateMathFunction
      extends MultiDateFunction

  `DateMathFunction` returns a start date modified by a list of DateMath operations.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `NAME`

    - ### Fields inherited from class org.apache.solr.analytics.util.valuesource.MultiDateFunction

      `sources`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DateMathFunction(ValueSource[] sources)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected long` | `func(int doc, FunctionValues[] valsArr)`
    `protected String` | `name()`

    - ### Methods inherited from class org.apache.solr.analytics.util.valuesource.MultiDateFunction

      `description, equals, getValues, hashCode`

    - ### Methods inherited from class org.apache.lucene.queries.function.ValueSource

      `createWeight, getSortField, newContext, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### NAME

          public static final String NAME

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DateMathFunction

          public DateMathFunction(ValueSource[] sources)

      Parameters:
        `sources` - A list of ValueSource objects. The first element in the list should be a `DateFieldSource` or `ConstDateSource` object which represents the starting date. The rest of the field should be `BytesRefFieldSource` or `ConstStringSource` objects which contain the DateMath operations to perform on the start date.

  - ### Method Detail

    - #### name

          protected String name()

      Specified by:
        `name` in class `MultiDateFunction`

    - #### func

          protected long func(int doc,
                              FunctionValues[] valsArr)

      Specified by:
        `func` in class `MultiDateFunction`

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.