Class FilterDelegate<T>

java.lang.Object
ddf.catalog.filter.FilterDelegate<T>
Type Parameters:
T - Generic type that the FilterDelegate will return as a final result

public abstract class FilterDelegate<T> extends Object
* FilterDelegate is the target delegate of the FilterAdapter. The FilterAdapter will visit a Filter and call the corresponding delegate methods after type conversion and input normalization.

Not all org.geotools.api.filter.Filter and Expression types are supported by the delegate. FilterAdapter and FilterDelegate would need to be extended to support other org.geotools.api.filter.Filter and org.geotools.api.filter.expression.Expression types. Alternatively, other types could be supported by implementing the FilterVisitor directly.

A reference implementation is provided with the DDF Core in the org.geotools.api.filter.Filter Proxy bundle.

See Also:
  • Field Details

    • WILDCARD_CHAR

      public static final String WILDCARD_CHAR
      Normalized wildcard character used to match zero or more characters.
      See Also:
    • SINGLE_CHAR

      public static final String SINGLE_CHAR
      Normalized single wildcard character used to match exactly one character
      See Also:
    • ESCAPE_CHAR

      public static final String ESCAPE_CHAR
      Normalized escape character used to escape the meaning of the wildCard, singleChar, and the escapeChar itself
      See Also:
  • Constructor Details

    • FilterDelegate

      public FilterDelegate()
  • Method Details

    • and

      public T and(List<T> operands)
      Logical "and" operation on a list of operands.
      Parameters:
      operands - list of operands to "and"
      Returns:
      result of "and" operation on operands
    • or

      public T or(List<T> operands)
      Logical "or" operation on a list of operands.
      Parameters:
      operands - list of T to "or"
      Returns:
      result of "or" operation on operands
    • nearestNeighbor

      public T nearestNeighbor(String propertyName, String wkt)
      Returns a sorted list of the nearest neighbors to a property for a given WKT.
      Parameters:
      propertyName - name of property to compare
      wkt - WKT geometry to compare
      Returns:
      result of nearest neighbor spatial operation
    • not

      public T not(T operand)
      Logical "not" operation on an operand.
      Parameters:
      operand - operand to negate
      Returns:
      result of "not" operation on operand
    • include

      public T include()
      Include filter is equivalent to no filtering or logically true.
      Returns:
      returns the equivalent of true
    • exclude

      public T exclude()
      Include filter is equivalent to filter all or logically false.
      Returns:
      returns the equivalent of false
    • propertyIsEqualTo

      public T propertyIsEqualTo(String propertyName, String literal, boolean isCaseSensitive)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      isCaseSensitive - case-sensitivity boolean
      Returns:
      result of equals operation between propertyName and literal
      See Also:
    • propertyIsEqualTo

      public T propertyIsEqualTo(String propertyName, Date literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of equals operation between propertyName and literal
      See Also:
    • propertyIsEqualTo

      public T propertyIsEqualTo(String propertyName, Date startDate, Date endDate)
      Parameters:
      propertyName - name of property to compare
      startDate - starting date of literal to compare
      endDate - ending date of literal to compare
      Returns:
      result of equals operation between propertyName and literal
      See Also:
    • propertyIsEqualTo

      public T propertyIsEqualTo(String propertyName, int literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of equals operation between propertyName and literal
      See Also:
    • propertyIsEqualTo

      public T propertyIsEqualTo(String propertyName, short literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of equals operation between propertyName and literal
      See Also:
    • propertyIsEqualTo

      public T propertyIsEqualTo(String propertyName, long literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of equals operation between propertyName and literal
      See Also:
    • propertyIsEqualTo

      public T propertyIsEqualTo(String propertyName, float literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of equals operation between propertyName and literal
      See Also:
    • propertyIsEqualTo

      public T propertyIsEqualTo(String propertyName, double literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of equals operation between propertyName and literal
      See Also:
    • propertyIsEqualTo

      public T propertyIsEqualTo(String propertyName, boolean literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of equals operation between propertyName and literal
      See Also:
    • propertyIsEqualTo

      public T propertyIsEqualTo(String propertyName, byte[] literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of equals operation between propertyName and literal
      See Also:
    • propertyIsEqualTo

      public T propertyIsEqualTo(String propertyName, Object literal)
      Compares the value associated with a property is equal to the value of a literal.

      propertyName == literal

      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of equals operation between propertyName and literal
    • propertyIsEqualTo

      public T propertyIsEqualTo(String functionName, List<Object> arguments, Object literal)
      Compares the function return value is equal to the value of a literal. Filter delegates will have to know the function argument types and return types for each specific function in order to support it, therefore to simplify the API they are just passed as objects.

      function result == literal

      Parameters:
      functionName - name of function
      arguments - list of arguments to pass to the function
      literal - value to compare
      Returns:
      result of equals operation between functionName result and literal
    • propertyIsNotEqualTo

      public T propertyIsNotEqualTo(String propertyName, String literal, boolean isCaseSensitive)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      isCaseSensitive - case-sensitivity boolean
      Returns:
      result of not equals operation between propertyName and literal
      See Also:
    • propertyIsNotEqualTo

      public T propertyIsNotEqualTo(String propertyName, Date literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of not equals operation between propertyName and literal
      See Also:
    • propertyIsNotEqualTo

      public T propertyIsNotEqualTo(String propertyName, Date startDate, Date endDate)
      Parameters:
      propertyName - name of property to compare
      startDate - starting date of literal to compare
      endDate - ending date of literal to compare
      Returns:
      result of not equals operation between propertyName and literal
      See Also:
    • propertyIsNotEqualTo

      public T propertyIsNotEqualTo(String propertyName, int literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of not equals operation between propertyName and literal
      See Also:
    • propertyIsNotEqualTo

      public T propertyIsNotEqualTo(String propertyName, short literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of not equals operation between propertyName and literal
      See Also:
    • propertyIsNotEqualTo

      public T propertyIsNotEqualTo(String propertyName, long literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of not equals operation between propertyName and literal
      See Also:
    • propertyIsNotEqualTo

      public T propertyIsNotEqualTo(String propertyName, float literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of not equals operation between propertyName and literal
      See Also:
    • propertyIsNotEqualTo

      public T propertyIsNotEqualTo(String propertyName, double literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of not equals operation between propertyName and literal
      See Also:
    • propertyIsNotEqualTo

      public T propertyIsNotEqualTo(String propertyName, boolean literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of not equals operation between propertyName and literal
      See Also:
    • propertyIsNotEqualTo

      public T propertyIsNotEqualTo(String propertyName, byte[] literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of not equals operation between propertyName and literal
      See Also:
    • propertyIsNotEqualTo

      public T propertyIsNotEqualTo(String propertyName, Object literal)
      Compares the value associated with a property is not equal to the value of a literal.

      propertyName != literal

      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of not equals operation between propertyName and literal
    • propertyIsGreaterThan

      public T propertyIsGreaterThan(String propertyName, String literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of greater than operation between propertyName and literal
      See Also:
    • propertyIsGreaterThan

      public T propertyIsGreaterThan(String propertyName, Date literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of greater than operation between propertyName and literal
      See Also:
    • propertyIsGreaterThan

      public T propertyIsGreaterThan(String propertyName, int literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of greater than operation between propertyName and literal
      See Also:
    • propertyIsGreaterThan

      public T propertyIsGreaterThan(String propertyName, short literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of greater than operation between propertyName and literal
      See Also:
    • propertyIsGreaterThan

      public T propertyIsGreaterThan(String propertyName, long literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of greater than operation between propertyName and literal
      See Also:
    • propertyIsGreaterThan

      public T propertyIsGreaterThan(String propertyName, float literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of greater than operation between propertyName and literal
      See Also:
    • propertyIsGreaterThan

      public T propertyIsGreaterThan(String propertyName, double literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of greater than operation between propertyName and literal
      See Also:
    • propertyIsGreaterThan

      public T propertyIsGreaterThan(String propertyName, Object literal)
      Compares the value associated with a property is greater than the value of a literal.

      propertyName > literal

      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of greater than operation between propertyName and literal
    • propertyIsGreaterThanOrEqualTo

      public T propertyIsGreaterThanOrEqualTo(String propertyName, String literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of greater than operation between propertyName and literal
      See Also:
    • propertyIsGreaterThanOrEqualTo

      public T propertyIsGreaterThanOrEqualTo(String propertyName, Date literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of greater than operation between propertyName and literal
      See Also:
    • propertyIsGreaterThanOrEqualTo

      public T propertyIsGreaterThanOrEqualTo(String propertyName, int literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of greater than operation between propertyName and literal
      See Also:
    • propertyIsGreaterThanOrEqualTo

      public T propertyIsGreaterThanOrEqualTo(String propertyName, short literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of greater than operation between propertyName and literal
      See Also:
    • propertyIsGreaterThanOrEqualTo

      public T propertyIsGreaterThanOrEqualTo(String propertyName, long literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of greater than operation between propertyName and literal
      See Also:
    • propertyIsGreaterThanOrEqualTo

      public T propertyIsGreaterThanOrEqualTo(String propertyName, float literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of greater than operation between propertyName and literal
      See Also:
    • propertyIsGreaterThanOrEqualTo

      public T propertyIsGreaterThanOrEqualTo(String propertyName, double literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of greater than operation between propertyName and literal
      See Also:
    • propertyIsGreaterThanOrEqualTo

      public T propertyIsGreaterThanOrEqualTo(String propertyName, Object literal)
      Compares the value associated with a property is greater than or equal to the value of a literal.

      propertyName >= literal

      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of greater than operation between propertyName and literal
    • propertyIsLessThan

      public T propertyIsLessThan(String propertyName, String literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of less than operation between propertyName and literal
      See Also:
    • propertyIsLessThan

      public T propertyIsLessThan(String propertyName, Date literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of less than operation between propertyName and literal
      See Also:
    • propertyIsLessThan

      public T propertyIsLessThan(String propertyName, int literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of less than operation between propertyName and literal
      See Also:
    • propertyIsLessThan

      public T propertyIsLessThan(String propertyName, short literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of less than operation between propertyName and literal
      See Also:
    • propertyIsLessThan

      public T propertyIsLessThan(String propertyName, long literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of less than operation between propertyName and literal
      See Also:
    • propertyIsLessThan

      public T propertyIsLessThan(String propertyName, float literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of less than operation between propertyName and literal
      See Also:
    • propertyIsLessThan

      public T propertyIsLessThan(String propertyName, double literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of less than operation between propertyName and literal
      See Also:
    • propertyIsLessThan

      public T propertyIsLessThan(String propertyName, Object literal)
      Compares the value associated with a property is less than the value of a literal.

      propertyName < literal

      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of less than operation between propertyName and literal
    • propertyIsLessThanOrEqualTo

      public T propertyIsLessThanOrEqualTo(String propertyName, String literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of less than or equal to operation between propertyName and literal
      See Also:
    • propertyIsLessThanOrEqualTo

      public T propertyIsLessThanOrEqualTo(String propertyName, Date literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of less than or equal to operation between propertyName and literal
      See Also:
    • propertyIsLessThanOrEqualTo

      public T propertyIsLessThanOrEqualTo(String propertyName, int literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of less than or equal to operation between propertyName and literal
      See Also:
    • propertyIsLessThanOrEqualTo

      public T propertyIsLessThanOrEqualTo(String propertyName, short literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of less than or equal to operation between propertyName and literal
      See Also:
    • propertyIsLessThanOrEqualTo

      public T propertyIsLessThanOrEqualTo(String propertyName, long literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of less than or equal to operation between propertyName and literal
      See Also:
    • propertyIsLessThanOrEqualTo

      public T propertyIsLessThanOrEqualTo(String propertyName, float literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of less than or equal to operation between propertyName and literal
      See Also:
    • propertyIsLessThanOrEqualTo

      public T propertyIsLessThanOrEqualTo(String propertyName, double literal)
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of less than or equal to operation between propertyName and literal
      See Also:
    • propertyIsLessThanOrEqualTo

      public T propertyIsLessThanOrEqualTo(String propertyName, Object literal)
      Compares the value associated with a property is less than or equal to the value of a literal.

      propertyName <= literal

      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of less than or equal to operation between propertyName and literal
    • propertyIsBetween

      public T propertyIsBetween(String propertyName, String lowerBoundary, String upperBoundary)
      Parameters:
      propertyName - name of property to compare
      lowerBoundary - lower boundary to compare
      upperBoundary - upper boundary to compare
      Returns:
      result of between operation
      See Also:
    • propertyIsBetween

      public T propertyIsBetween(String propertyName, Date lowerBoundary, Date upperBoundary)
      Parameters:
      propertyName - name of property to compare
      lowerBoundary - lower boundary to compare
      upperBoundary - upper boundary to compare
      Returns:
      result of between operation
      See Also:
    • propertyIsBetween

      public T propertyIsBetween(String propertyName, int lowerBoundary, int upperBoundary)
      Parameters:
      propertyName - name of property to compare
      lowerBoundary - lower boundary to compare
      upperBoundary - upper boundary to compare
      Returns:
      result of between operation
      See Also:
    • propertyIsBetween

      public T propertyIsBetween(String propertyName, short lowerBoundary, short upperBoundary)
      Parameters:
      propertyName - name of property to compare
      lowerBoundary - lower boundary to compare
      upperBoundary - upper boundary to compare
      Returns:
      result of between operation
      See Also:
    • propertyIsBetween

      public T propertyIsBetween(String propertyName, long lowerBoundary, long upperBoundary)
      Parameters:
      propertyName - name of property to compare
      lowerBoundary - lower boundary to compare
      upperBoundary - upper boundary to compare
      Returns:
      result of between operation
      See Also:
    • propertyIsBetween

      public T propertyIsBetween(String propertyName, float lowerBoundary, float upperBoundary)
      Parameters:
      propertyName - name of property to compare
      lowerBoundary - lower boundary to compare
      upperBoundary - upper boundary to compare
      Returns:
      result of between operation
      See Also:
    • propertyIsBetween

      public T propertyIsBetween(String propertyName, double lowerBoundary, double upperBoundary)
      Parameters:
      propertyName - name of property to compare
      lowerBoundary - lower boundary to compare
      upperBoundary - upper boundary to compare
      Returns:
      result of between operation
      See Also:
    • propertyIsBetween

      public T propertyIsBetween(String propertyName, Object lowerBoundary, Object upperBoundary)
      Compares the value associated with a property is between a lower and upper boundary. This is an exclusive comparison.

      lower < propertyName < upper

      Parameters:
      propertyName - name of property to compare
      lowerBoundary - lower boundary to compare
      upperBoundary - upper boundary to compare
      Returns:
      result of between operation
    • propertyIsNull

      public T propertyIsNull(String propertyName)
      Compares the value associated with a property is equal to null.

      propertyName == null

      Parameters:
      propertyName - name of property to compare
      Returns:
      result of null check
    • propertyIsLike

      public T propertyIsLike(String propertyName, String pattern, boolean isCaseSensitive)
      Compares the value associated with a property to a regular expression pattern.

      Regular expression special characters are defined as WILDCARD_CHAR, SINGLE_CHAR, and ESCAPE_CHAR.

      Parameters:
      propertyName - name of property to compare
      pattern - regular expression pattern to match
      isCaseSensitive - case-sensitivity boolean
      Returns:
      result of regular expression operation
    • propertyIsFuzzy

      public T propertyIsFuzzy(String propertyName, String literal)
      Compares the value associated with a property to the value of a literal with a fuzzy operator which expands the literal to match misspellings.
      Parameters:
      propertyName - name of property to compare
      literal - value to compare
      Returns:
      result of fuzzy operation
    • xpathExists

      @Deprecated public T xpathExists(String xpath)
      Deprecated.
      Determines if a node expressed by XPath exists.
      Parameters:
      xpath - XPath expression
      Returns:
      result of XPath node existence
    • xpathIsLike

      @Deprecated public T xpathIsLike(String xpath, String pattern, boolean isCaseSensitive)
      Deprecated.
      Compares the node expressed by XPath to a regular expression pattern.
      Parameters:
      xpath - XPath expression
      pattern - regular expression pattern to match
      isCaseSensitive - case-sensitivity boolean
      Returns:
      result of regular expression operation on XPath node
      See Also:
    • xpathIsFuzzy

      @Deprecated public T xpathIsFuzzy(String xpath, String literal)
      Deprecated.
      Compares the node expressed by XPath to the value of a literal with a fuzzy operator which expands the literal to match misspellings.
      Parameters:
      xpath - XPath expression
      literal - value to compare
      Returns:
      result of fuzzy operation on XPath node
    • beyond

      public T beyond(String propertyName, String wkt, double distance)
      Compares the geometry associated with a property is beyond a distance from a WKT geometry.
      Parameters:
      propertyName - name of property to compare
      wkt - WKT geometry to compare
      distance - distance buffer in meters
      Returns:
      result of beyond spatial operation
    • contains

      public T contains(String propertyName, String wkt)
      Compares the geometry associated with a property is contained by a WKT geometry.
      Parameters:
      propertyName - name of property to compare
      wkt - WKT geometry to compare
      Returns:
      result of contains spatial operation
    • crosses

      public T crosses(String propertyName, String wkt)
      Compares the geometry associated with a property crosses a WKT geometry.
      Parameters:
      propertyName - name of property to compare
      wkt - WKT geometry to compare
      Returns:
      result of crosses spatial operation
    • disjoint

      public T disjoint(String propertyName, String wkt)
      Compares the geometry associated with a property is disjoint from a WKT geometry.
      Parameters:
      propertyName - name of property to compare
      wkt - WKT geometry to compare
      Returns:
      result of disjoint spatial operation
    • dwithin

      public T dwithin(String propertyName, String wkt, double distance)
      Compares the geometry associated with a property is within a distance from a WKT geometry.
      Parameters:
      propertyName - name of property to compare
      wkt - WKT geometry to compare
      distance - distance buffer in meters
      Returns:
      result of dwithin spatial operation
    • intersects

      public T intersects(String propertyName, String wkt)
      Compares the geometry associated with a property intersects a WKT geometry.
      Parameters:
      propertyName - name of property to compare
      wkt - WKT geometry to compare
      Returns:
      result of intersects spatial operation
    • overlaps

      public T overlaps(String propertyName, String wkt)
      Compares the geometry associated with a property overlaps a WKT geometry.
      Parameters:
      propertyName - name of property to compare
      wkt - WKT geometry to compare
      Returns:
      result of overlaps spatial operation
    • touches

      public T touches(String propertyName, String wkt)
      Compares the geometry associated with a property touches a WKT geometry.
      Parameters:
      propertyName - name of property to compare
      wkt - WKT geometry to compare
      Returns:
      result of touches spatial operation
    • within

      public T within(String propertyName, String wkt)
      Compares the geometry associated with a property is within a WKT geometry.
      Parameters:
      propertyName - name of property to compare
      wkt - WKT geometry to compare
      Returns:
      result of within spatial operation
    • after

      public T after(String propertyName, Date date)
      Compares the value associated with a property is after a given Date. This is an exclusive comparison.

      property > date

      Parameters:
      propertyName - name of property to compare
      date - Date to compare
      Returns:
      result of after temporal operation
    • before

      public T before(String propertyName, Date date)
      Compares the value associated with a property is before a given Date.This is an exclusive comparison.

      property < date

      Parameters:
      propertyName - name of property to compare
      date - Date to compare
      Returns:
      result of before temporal operation
    • during

      public T during(String propertyName, Date startDate, Date endDate)
      Compares the value associated with a property is between a start and end date. This is an exclusive comparison.

      startDate < property < endDate

      Parameters:
      propertyName - name of property to compare
      startDate - start date to compare
      endDate - end date to compare
      Returns:
      result of during temporal operation
    • begins

      public T begins(String propertyName, Date startDate, Date endDate)
      Compares the value associated with the property by checking if it is start at the start date and ends some time before the endDate
      Parameters:
      propertyName - name of property to compare
      startDate - start date to compare
      endDate - end date to compare
      Returns:
      result of begins temporal operation
    • relative

      public T relative(String propertyName, long duration)
      Compares the value associated with a property is relatively within a duration of milliseconds in the past from the current time of evaluation.
      Parameters:
      propertyName - name of property to compare
      duration - relative duration in milliseconds
      Returns:
      result of relative temporal operation