| 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; |
| 9 | |
| 10 | import net.sf.saxon.expr.sort.AtomicComparer; |
| 11 | |
| 12 | /** |
| 13 | * Interface implemented by expressions that perform a comparison |
| 14 | */ |
| 15 | public interface ComparisonExpression { |
| 16 | |
| 17 | /** |
| 18 | * Get the AtomicComparer used to compare atomic values. This encapsulates any collation that is used |
| 19 | */ |
| 20 | |
| 21 | AtomicComparer getAtomicComparer(); |
| 22 | |
| 23 | /** |
| 24 | * Get the primitive (singleton) operator used: one of Token.FEQ, Token.FNE, Token.FLT, Token.FGT, |
| 25 | * Token.FLE, Token.FGE |
| 26 | */ |
| 27 | |
| 28 | int getSingletonOperator(); |
| 29 | |
| 30 | /** |
| 31 | * Get the two operands of the comparison |
| 32 | */ |
| 33 | |
| 34 | Operand getLhs(); |
| 35 | |
| 36 | Operand getRhs(); |
| 37 | |
| 38 | Expression getLhsExpression(); |
| 39 | |
| 40 | Expression getRhsExpression(); |
| 41 | |
| 42 | /** |
| 43 | * Determine whether untyped atomic values should be converted to the type of the other operand |
| 44 | * |
| 45 | * @return true if untyped values should be converted to the type of the other operand, false if they |
| 46 | * should be converted to strings. |
| 47 | */ |
| 48 | |
| 49 | boolean convertsUntypedToOther(); |
| 50 | } |
| 51 |