KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > core > model > JDIPrimitiveValue


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.debug.core.model;
12
13  
14 import org.eclipse.jdt.debug.core.IJavaPrimitiveValue;
15
16 import com.sun.jdi.PrimitiveValue;
17 import com.sun.jdi.Value;
18
19 /**
20  * A primitive value on a Java debug target
21  */

22 public class JDIPrimitiveValue extends JDIValue implements IJavaPrimitiveValue {
23
24     /**
25      * Constructs a new primitive value.
26      *
27      * @param target the Java debug target
28      * @param value the underlying JDI primitive value
29      */

30     public JDIPrimitiveValue(JDIDebugTarget target, Value value) {
31         super(target, value);
32     }
33     
34     /**
35      * Returns this value's underlying primtive value
36      *
37      * @return underlying primtive value
38      */

39     protected PrimitiveValue getUnderlyingPrimitiveValue() {
40         return (PrimitiveValue)getUnderlyingValue();
41     }
42
43     /*
44      * @see IJavaPrimitiveValue#getBooleanValue()
45      */

46     public boolean getBooleanValue() {
47         return getUnderlyingPrimitiveValue().booleanValue();
48     }
49
50     /*
51      * @see IJavaPrimitiveValue#getByteValue()
52      */

53     public byte getByteValue() {
54         return getUnderlyingPrimitiveValue().byteValue();
55     }
56
57     /*
58      * @see IJavaPrimitiveValue#getCharValue()
59      */

60     public char getCharValue() {
61         return getUnderlyingPrimitiveValue().charValue();
62     }
63
64     /*
65      * @see IJavaPrimitiveValue#getDoubleValue()
66      */

67     public double getDoubleValue() {
68         return getUnderlyingPrimitiveValue().doubleValue();
69     }
70
71     /*
72      * @see IJavaPrimitiveValue#getFloatValue()
73      */

74     public float getFloatValue() {
75         return getUnderlyingPrimitiveValue().floatValue();
76     }
77
78     /*
79      * @see IJavaPrimitiveValue#getIntValue()
80      */

81     public int getIntValue() {
82         return getUnderlyingPrimitiveValue().intValue();
83     }
84
85     /*
86      * @see IJavaPrimitiveValue#getLongValue()
87      */

88     public long getLongValue() {
89         return getUnderlyingPrimitiveValue().longValue();
90     }
91
92     /*
93      * @see IJavaPrimitiveValue#getShortValue()
94      */

95     public short getShortValue() {
96         return getUnderlyingPrimitiveValue().shortValue();
97     }
98
99 }
100
101
Popular Tags