01: /*
02: * Copyright (C) The MX4J Contributors.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the MX4J License version 1.0.
06: * See the terms of the MX4J License in the documentation provided with this software.
07: */
08:
09: package javax.management;
10:
11: /**
12: * The ValueExp that represents a number.
13: *
14: * @version $Revision: 1.6 $
15: * @serial include
16: */
17: class NumericValueExp extends QueryEval implements ValueExp {
18: private static final long serialVersionUID = -4679739485102359104L;
19:
20: /**
21: * @serial The number
22: */
23: private Number val;
24:
25: NumericValueExp(Number val) {
26: this .val = val;
27: }
28:
29: public ValueExp apply(ObjectName name)
30: throws BadStringOperationException,
31: BadBinaryOpValueExpException,
32: BadAttributeValueExpException, InvalidApplicationException {
33: return this ;
34: }
35:
36: boolean isDouble() {
37: return val instanceof Float || val instanceof Double;
38: }
39:
40: double doubleValue() {
41: return val.doubleValue();
42: }
43:
44: long longValue() {
45: return val.longValue();
46: }
47: }
|