gnu.kawa.functions

Class NumberCompare

public class NumberCompare extends ProcedureN implements CanInline, Inlineable

This implements the numeric comparison relations: <, <=, etc.
Field Summary
static intTRUE_IF_EQU
static intTRUE_IF_GRT
static intTRUE_IF_LSS
static intTRUE_IF_NAN
static intTRUE_IF_NEQ
Method Summary
Objectapply2(Object arg1, Object arg2)
static booleanapply2(int flags, Object arg1, Object arg2)
ObjectapplyN(Object[] args)
static booleanapplyWithPromotion(int flags, Object arg1, Object arg2)
static booleancheckCompareCode(int code, int flags)
static intcompare(Object arg1, Object arg2, boolean exact)
Compare two numbers.
static intcompare(Object arg1, int code1, Object arg2, int code2, boolean exact)
voidcompile(ApplyExp exp, Compilation comp, Target target)
protected LanguagegetLanguage()
TypegetReturnType(Expression[] args)
Expressioninline(ApplyExp exp, ExpWalker walker)
static NumberComparemake(Language language, String name, int flags)
intnumArgs()
static boolean$Eq(Object arg1, Object arg2)
static boolean$Eq$V(Object arg1, Object arg2, Object arg3, Object[] rest)
static boolean$Gr(Object arg1, Object arg2)
static boolean$Gr$Eq(Object arg1, Object arg2)
static boolean$Gr$Eq$V(Object arg1, Object arg2, Object arg3, Object[] rest)
static boolean$Gr$V(Object arg1, Object arg2, Object arg3, Object[] rest)
static boolean$Ls(Object arg1, Object arg2)
static boolean$Ls$Eq(Object arg1, Object arg2)
static boolean$Ls$Eq$V(Object arg1, Object arg2, Object arg3, Object[] rest)
static boolean$Ls$V(Object arg1, Object arg2, Object arg3, Object[] rest)

Field Detail

TRUE_IF_EQU

public static final int TRUE_IF_EQU

TRUE_IF_GRT

public static final int TRUE_IF_GRT

TRUE_IF_LSS

public static final int TRUE_IF_LSS

TRUE_IF_NAN

public static final int TRUE_IF_NAN

TRUE_IF_NEQ

public static final int TRUE_IF_NEQ

Method Detail

apply2

public Object apply2(Object arg1, Object arg2)

apply2

public static boolean apply2(int flags, Object arg1, Object arg2)

applyN

public Object applyN(Object[] args)

applyWithPromotion

public static boolean applyWithPromotion(int flags, Object arg1, Object arg2)

checkCompareCode

public static boolean checkCompareCode(int code, int flags)

compare

public static int compare(Object arg1, Object arg2, boolean exact)
Compare two numbers.

Parameters: exact true if we should compare exact/inexact numbers exactly (by converting the inexact number to exact), or inexactly (by "promoting" the exact to inexact) (as required for XQuery).

Returns: 1 if {@code arg1>arg2}; 0 if {@code arg1==arg2}; -1 if {@code arg1

compare

public static int compare(Object arg1, int code1, Object arg2, int code2, boolean exact)

compile

public void compile(ApplyExp exp, Compilation comp, Target target)

getLanguage

protected final Language getLanguage()

getReturnType

public Type getReturnType(Expression[] args)

inline

public Expression inline(ApplyExp exp, ExpWalker walker)

make

public static NumberCompare make(Language language, String name, int flags)

numArgs

public int numArgs()

$Eq

public static boolean $Eq(Object arg1, Object arg2)

$Eq$V

public static boolean $Eq$V(Object arg1, Object arg2, Object arg3, Object[] rest)

$Gr

public static boolean $Gr(Object arg1, Object arg2)

$Gr$Eq

public static boolean $Gr$Eq(Object arg1, Object arg2)

$Gr$Eq$V

public static boolean $Gr$Eq$V(Object arg1, Object arg2, Object arg3, Object[] rest)

$Gr$V

public static boolean $Gr$V(Object arg1, Object arg2, Object arg3, Object[] rest)

$Ls

public static boolean $Ls(Object arg1, Object arg2)

$Ls$Eq

public static boolean $Ls$Eq(Object arg1, Object arg2)

$Ls$Eq$V

public static boolean $Ls$Eq$V(Object arg1, Object arg2, Object arg3, Object[] rest)

$Ls$V

public static boolean $Ls$V(Object arg1, Object arg2, Object arg3, Object[] rest)