Class XSDDuration

java.lang.Object
org.apache.jena.sparql.expr.nodevalue.XSDDuration

public class XSDDuration extends Object
Functions relating to XSD durations (F&O 3.1), using javax.xml.datatype.Duration
  • Constructor Details

    • XSDDuration

      public XSDDuration()
  • Method Details

    • durationCompare

      public static int durationCompare(Duration duration1, Duration duration2)
      Compare durations.

      There are two value spaces: year-month and day-time.

      Value spaces are determined dynamically, not from the datatype.

      Comparison across these two spaces is not possible except in the case of zero duration. This function returns Expr.CMP_UNEQUAL for durations in different value spaces which are not both zero.

      If the comparison using the JDK throws "UnsupportedOperationException", this function returns Expr.CMP_INDETERMINATE. (this occurs if field values are too large - larger than Integer.MAX_VALUE.

      Comparison operators on durations

      "With the exception of the zero-length duration, no instance of xs:dayTimeDuration can ever be equal to an instance of xs:yearMonthDuration."
    • durationIsZero

      public static boolean durationIsZero(Duration duration)
      Test whether a duration is zero