KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > management > BooleanValueExp


1 /*
2  * @(#)BooleanValueExp.java 4.17 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.management;
9
10
11 /**
12  * This class represents a boolean value. A BooleanValueExp may be
13  * used anywhere a ValueExp is required.
14  * @serial include
15  *
16  * @since 1.5
17  */

18 class BooleanValueExp extends QueryEval JavaDoc implements ValueExp JavaDoc {
19
20     /* Serial version */
21     private static final long serialVersionUID = 7754922052666594581L;
22
23     /**
24      * @serial The boolean value
25      */

26     private boolean val = false;
27
28
29     /** Creates a new BooleanValueExp representing the boolean literal <val>.*/
30     BooleanValueExp(boolean val) {
31     this.val = val;
32     }
33   
34     /**Creates a new BooleanValueExp representing the Boolean object <val>.*/
35     BooleanValueExp(Boolean JavaDoc val) {
36     this.val = val.booleanValue();
37     }
38
39
40     /** Returns the Boolean object representing the value of the BooleanValueExp object.*/
41     public Boolean JavaDoc getValue() {
42     return new Boolean JavaDoc(val);
43     }
44
45     /**
46      * Returns the string representing the object.
47      */

48     public String JavaDoc toString() {
49     return String.valueOf(val);
50     }
51
52     /**
53      * Applies the ValueExp on a MBean.
54      *
55      * @param name The name of the MBean on which the ValueExp will be applied.
56      *
57      * @return The <CODE>ValueExp</CODE>.
58      *
59      * @exception BadStringOperationException
60      * @exception BadBinaryOpValueExpException
61      * @exception BadAttributeValueExpException
62      * @exception InvalidApplicationException
63      */

64     public ValueExp JavaDoc apply(ObjectName JavaDoc name) throws BadStringOperationException JavaDoc, BadBinaryOpValueExpException JavaDoc,
65     BadAttributeValueExpException JavaDoc, InvalidApplicationException JavaDoc {
66     return this;
67     }
68
69  }
70
Popular Tags