Debian Codegraph @

net/sf/saxon/expr/sort/NumericComparer11.java

raw symbols SCIP
1 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2018 Saxonica Limited.
3 // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4 // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 // This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
6 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
7
8 package net.sf.saxon.expr.sort;
9
10 import net.sf.saxon.value.StringToDouble11;
11
12 /**
13 * A Comparer used for comparing sort keys when data-type="number". The items to be
14 * compared are converted to numbers, and the numbers are then compared directly. NaN values
15 * compare equal to each other, and equal to an empty sequence, but less than anything else.
16 * <p>This class is used in XSLT only, so there is no need to handle XQuery's "empty least" vs
17 * "empty greatest" options.</p>
18 *
19 * @author Michael H. Kay
20 */
21
22 public class NumericComparer11 extends NumericComparer {
23
24 private static NumericComparer11 THE_INSTANCE = new NumericComparer11();
25
26 /*@NotNull*/
27 public static NumericComparer getInstance() {
28 return THE_INSTANCE;
29 }
30
31 protected NumericComparer11() {
32 converter = StringToDouble11.getInstance();
33 }
34
35 /**
36 * Create a string representation of this AtomicComparer that can be saved in a compiled
37 * package and used to reconstitute the AtomicComparer when the package is reloaded
38 *
39 * @return a string representation of the AtomicComparer
40 */
41 @Override
42 public String save() {
43 return "NC11";
44 }
45 }
46