KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > core > model > IValue


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.debug.core.model;
12
13  
14 import org.eclipse.debug.core.DebugException;
15
16 /**
17  * A value represents the value of a variable.
18  * A value representing a complex data structure contains variables.
19  * <p>
20  * An implementation may choose to re-use or discard
21  * values on iterative thread suspensions. Clients
22  * cannot assume that values are identical or equal across
23  * iterative thread suspensions and must check for equality on iterative
24  * suspensions if they wish to re-use the objects.
25  * </p>
26  * <p>
27  * An implementation that preserves equality
28  * across iterative suspensions may display more desirable behavior in
29  * some clients. For example, if variables are preserved
30  * while stepping, a UI client would be able to update the UI incrementally,
31  * rather than collapse and redraw the entire list or tree.
32  * </p>
33  * <p>
34  * Clients may implement this interface.
35  * </p>
36  * @see IVariable
37  */

38
39
40 public interface IValue extends IDebugElement {
41     
42     /**
43      * Returns a description of the type of data this value contains
44      * or references.
45      *
46      * @return the name of this value's reference type
47      * @exception DebugException if this method fails. Reasons include:
48      * <ul><li>Failure communicating with the VM. The DebugException's
49      * status code contains the underlying exception responsible for
50      * the failure.</li>
51      */

52     public String JavaDoc getReferenceTypeName() throws DebugException;
53     
54     /**
55      * Returns this value as a <code>String</code>.
56      *
57      * @return a String representation of this value
58      * @exception DebugException if this method fails. Reasons include:
59      * <ul><li>Failure communicating with the VM. The DebugException's
60      * status code contains the underlying exception responsible for
61      * the failure.</li>
62      */

63     public String JavaDoc getValueString() throws DebugException;
64         
65     /**
66      * Returns whether this value is currently allocated.
67      * <p>
68      * For example, if this value represents
69      * an object that has been garbage collected, <code>false</code> is returned.
70      * </p>
71      * @return whether this value is currently allocated
72      * @exception DebugException if this method fails. Reasons include:
73      * <ul><li>Failure communicating with the VM. The DebugException's
74      * status code contains the underlying exception responsible for
75      * the failure.</li>
76      */

77     public boolean isAllocated() throws DebugException;
78     /**
79      * Returns the visible variables in this value. An empty
80      * collection is returned if there are no visible variables.
81      *
82      * @return an array of visible variables
83      * @exception DebugException if this method fails. Reasons include:
84      * <ul><li>Failure communicating with the VM. The DebugException's
85      * status code contains the underlying exception responsible for
86      * the failure.</li>
87      * </ul>
88      * @since 2.0
89      */

90     public IVariable[] getVariables() throws DebugException;
91     
92     /**
93      * Returns whether this value currently contains any visible variables.
94      *
95      * @return whether this value currently contains any visible variables
96      * @exception DebugException if this method fails. Reasons include:
97      * <ul><li>Failure communicating with the debug target. The DebugException's
98      * status code contains the underlying exception responsible for
99      * the failure.</li>
100      * </ul>
101      * @since 2.0
102      */

103     public boolean hasVariables() throws DebugException;
104 }
105
Popular Tags