Class XSDNumUtils

java.lang.Object
org.apache.jena.sparql.util.XSDNumUtils

public class XSDNumUtils extends Object
  • Constructor Details

    • XSDNumUtils

      public XSDNumUtils()
  • Method Details

    • xsdParseDouble

      public static double xsdParseDouble(String lexicalForm)
      Parse an XSD double lexical form. Adds in the cases not covered by Double.parseDouble(java.lang.String). INF is strictly upper case, but we accept lower case. -NaN and +NaN are not accepted.
    • xsdParseFloat

      public static float xsdParseFloat(String lexicalForm)
      Parse an XSD float lexical form. Adds in the cases not covered by Float.parseFloat(java.lang.String). INF is strictly upper case, but we accept lower case. -NaN and +NaN are not accepted.
    • xsdParseDecimal

      public static BigDecimal xsdParseDecimal(String lexicalForm)
      Parse an XSD decimal.
    • stringForm

      public static String stringForm(BigDecimal decimal)
      Produce a lexical form for BigDecimal that is compatible with Turtle syntax (i.e it has a decimal point).
    • stringForm

      public static String stringForm(double d)
    • stringForm

      public static String stringForm(float f)
    • stringFormatARQ

      public static String stringFormatARQ(BigDecimal bd)
      The format of xsd:decimal used in ARQ expression evaluation. This is XSD 1.0 for long-term consistency (integer values for xsd:decimal have ".0").
    • stringFormatXSD10

      public static String stringFormatXSD10(BigDecimal bd)
      Strict XSD 1.0 format for xsd:decimal.
    • stringFormatXSD11

      public static String stringFormatXSD11(BigDecimal bd)
      Strict XSD 1.1 format for xsd:decimal.
    • canonicalDecimalStrNoIntegerDot

      public static String canonicalDecimalStrNoIntegerDot(BigDecimal bd)
      Decimal format, cast-to-string.

      Decimal canonical form where integer values have no ".0" (as in XSD 1.1).

      In XSD 1.1, canonical integer-valued decimal has a trailing ".0". In F&O v 3.1, xs:string cast of a decimal which is integer valued, does not have the trailing ".0".

    • canonicalDecimalStrWithDot

      public static String canonicalDecimalStrWithDot(BigDecimal decimal)
      Integer-valued decimals have a trailing ".0". (In XML Schema Datatype 1.1 they did not have a ".0".)