gnu.xquery.util
Class ArithOp
java.lang.Object
gnu.mapping.PropertySet
gnu.mapping.Procedure
gnu.mapping.Procedure1or2
gnu.xquery.util.ArithOp
- All Implemented Interfaces:
- CanInline, Inlineable, Named
public class ArithOp
- extends Procedure1or2
- implements CanInline, Inlineable
Methods inherited from class gnu.mapping.Procedure |
apply, apply, check0, check1, check2, check3, check4, checkArgCount, checkN, getSetter, getSourceLocation, match0, match1, match2, match3, match4, matchN, maxArgs, minArgs, set0, set1, setN, setSetter, setSourceLocation, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
add
public static final ArithOp add
sub
public static final ArithOp sub
mul
public static final ArithOp mul
div
public static final ArithOp div
idiv
public static final ArithOp idiv
mod
public static final ArithOp mod
plus
public static final ArithOp plus
minus
public static final ArithOp minus
apply1
public java.lang.Object apply1(java.lang.Object arg1)
throws java.lang.Throwable
- Specified by:
apply1
in class Procedure1or2
- Throws:
java.lang.Throwable
div
public static java.math.BigDecimal div(java.math.BigDecimal d1,
java.math.BigDecimal d2)
apply2
public java.lang.Object apply2(java.lang.Object arg1,
java.lang.Object arg2)
throws java.lang.Throwable
- Specified by:
apply2
in class Procedure1or2
- Throws:
java.lang.Throwable
inline
public Expression inline(ApplyExp exp,
InlineCalls walker,
boolean argsInlined)
- Description copied from interface:
CanInline
- Inline an application of this Procedure and return result.
Unless
argsInlined
is true, then this method
is responsible for walking exp.getArgs()
;
you can handle this using exp.getArgs(walker, argsInlined)
.
(The exp.getFunction()
has been walked, regardless.)
- Specified by:
inline
in interface CanInline
argsInlined
- true if the arguments have been inlined.
Can return original expression.
compile
public void compile(ApplyExp exp,
Compilation comp,
Target target)
- Specified by:
compile
in interface Inlineable
getReturnType
public Type getReturnType(Expression[] args)
- Specified by:
getReturnType
in interface Inlineable