public class OwExprNumericValue extends OwExprValue implements Comparable
The numeric value implementation.
Objects of this class represent floating point or integer numeric values.
The implementation relays on the Number
Java implementation.
Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.
For licensing information read the license.txt file or
go to: http://wiki.alfresco.com
Constructor and Description |
---|
OwExprNumericValue(double doubleNo_p)
Constructor
|
OwExprNumericValue(int number_p)
Constructor
|
OwExprNumericValue(Number number_p)
Constructor
|
OwExprNumericValue(Number number_p,
Class<?> javaType_p)
Constructor
|
Modifier and Type | Method and Description |
---|---|
OwExprValue |
accept(OwExprBinaryOperator binaryOperator_p,
OwExprNumericValue v1_p)
Stage 2 binary operator visitor acceptance method
|
OwExprValue |
accept(OwExprBinaryOperator binaryOperator_p,
OwExprStringValue v1_p)
Stage 2 binary operator visitor acceptance method
|
OwExprValue |
accept(OwExprBinaryOperator binaryOperator_p,
OwExprValue v2_p)
Stage 1 binary operator visitor acceptance method
|
OwExprValue |
accept(OwExprUnaryOperator unaryOperator_p)
Unary operator visitor acceptance method
|
OwExprNumericValue |
add(OwExprNumericValue numeric_p) |
int |
compareTo(Object o_p) |
OwExprValue |
div(OwExprNumericValue numeric_p) |
boolean |
equals(Object obj_p) |
int |
hashCode() |
OwExprValue |
mul(OwExprNumericValue numeric_p) |
OwExprNumericValue |
negate() |
OwExprValue |
reminder(OwExprNumericValue numeric_p) |
OwExprValue |
sub(OwExprNumericValue numeric_p) |
int |
toInt() |
Object |
toJavaObject(Class javaSuperType_p)
Java class conversion method.
|
String |
toString() |
accept, accept, accept, accept, at, fromJavaValue, fromJavaValue, function, getJavaType, getValuePropeties, hasProperty, length, property
public OwExprNumericValue(Number number_p, Class<?> javaType_p)
number_p
- the inner numeric valuejavaType_p
- original java typepublic OwExprNumericValue(Number number_p)
number_p
- the inner numeric valuepublic OwExprNumericValue(int number_p)
number_p
- the inner numeric valuepublic OwExprNumericValue(double doubleNo_p)
doubleNo_p
- the inner numeric valuepublic final OwExprValue accept(OwExprBinaryOperator binaryOperator_p, OwExprValue v2_p) throws OwExprEvaluationException
OwExprValue
accept
in class OwExprValue
binaryOperator_p
- binary operator visitorv2_p
- right side operator valueOwExprValue
OwExprEvaluationException
- if the operation fails for any reason (unsupported operand types ,
incompatible operands, unimplemented operation or operation failure at evaluation time)public final OwExprValue accept(OwExprBinaryOperator binaryOperator_p, OwExprNumericValue v1_p) throws OwExprEvaluationException
OwExprValue
accept
in class OwExprValue
binaryOperator_p
- binary operator visitorv1_p
- lef side operator valueOwExprValue
OwExprEvaluationException
- if the operation fails for any reason (unsupported operand types ,
incompatible operands, unimplemented operation or operation failure at evaluation time)public final OwExprValue accept(OwExprBinaryOperator binaryOperator_p, OwExprStringValue v1_p) throws OwExprEvaluationException
OwExprValue
accept
in class OwExprValue
binaryOperator_p
- binary operator visitorv1_p
- lef side operator valueOwExprValue
OwExprEvaluationException
- if the operation fails for any reason (unsupported operand types ,
incompatible operands, unimplemented operation or operation failure at evaluation time)public OwExprValue accept(OwExprUnaryOperator unaryOperator_p) throws OwExprEvaluationException
OwExprValue
accept
in class OwExprValue
unaryOperator_p
- binary operator visitorOwExprValue
OwExprEvaluationException
- if the operation fails for any reason (unsupported operand types ,
incompatible operands, unimplemented operation or operation failure at evaluation time)public OwExprNumericValue add(OwExprNumericValue numeric_p)
public OwExprNumericValue negate()
new OwExprNumericValue(1).negate().equals(new OwExprNumericValue(-1))
public OwExprValue sub(OwExprNumericValue numeric_p)
numeric_p
- OwExprNumericValue
representing this numeric value minus the numeric value of the numeric_p parameterpublic OwExprValue mul(OwExprNumericValue numeric_p)
numeric_p
- OwExprNumericValue
representing this numeric multiplied by the numeric value of the numeric_p parameterpublic OwExprValue div(OwExprNumericValue numeric_p) throws ArithmeticException
numeric_p
- OwExprNumericValue
representing this numeric divided by the numeric value of the numeric_p parameterArithmeticException
public OwExprValue reminder(OwExprNumericValue numeric_p) throws ArithmeticException
numeric_p
- OwExprNumericValue
representing reminder of the division of this numeric value and the numeric value of the numeric_p parameterArithmeticException
public int toInt()
public int compareTo(Object o_p)
compareTo
in interface Comparable
public Object toJavaObject(Class javaSuperType_p) throws OwExprEvaluationException
OwExprValue
toJavaObject
in class OwExprValue
javaSuperType_p
- Integer
if javaSuperType_p is different from Double.class
and Double.TYPE
Double
otherwiseOwExprEvaluationException
Copyright © 2014 Alfresco Business Solutions. All Rights Reserved.