org.eclipse.cdt.debug.internal.core.model
Class CVariable

java.lang.Object
  extended by org.eclipse.core.runtime.PlatformObject
      extended by org.eclipse.cdt.debug.internal.core.model.CDebugElement
          extended by org.eclipse.cdt.debug.internal.core.model.AbstractCVariable
              extended by org.eclipse.cdt.debug.internal.core.model.CVariable
All Implemented Interfaces:
org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener, ICastToArray, ICastToType, ICDebugElement, ICDebugElementStatus, ICVariable, IEnableDisableTarget, IFormatSupport, org.eclipse.core.runtime.IAdaptable, org.eclipse.debug.core.model.IDebugElement, org.eclipse.debug.core.model.IValueModification, org.eclipse.debug.core.model.IVariable
Direct Known Subclasses:
CGlobalVariable, CLocalVariable, CRegister

public abstract class CVariable
extends AbstractCVariable
implements org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener

Represents a variable in the CDI model.


Field Summary
 
Fields inherited from interface org.eclipse.cdt.debug.core.model.ICDebugElementStatus
ERROR, OK, WARNING
 
Method Summary
 boolean canCast()
          Returns whether this element can currently be casted.
 boolean canCastToArray()
          Returns whether this element can be currently casted to array.
 boolean canEnableDisable()
          Returns whether this object supports enable/disable operations.
 void cast(java.lang.String type)
          Performs the casting to the given type.
 void castToArray(int startIndex, int length)
          Performs the casting.
 void changeFormat(CVariableFormat format)
          Sets the current format of this variable to format.
 void dispose()
           
 boolean equals(java.lang.Object obj)
          Compares the original internal variables.
 java.lang.String getCurrentType()
          Returns the string presentation of the current type.
 java.lang.String getExpressionString()
          Returns the text presentation of this variable as an expression.
 CVariableFormat getFormat()
          Returns the current format of this variable.
 java.lang.String getName()
           
 java.lang.String getReferenceTypeName()
           
 ICType getType()
          Returns the type of this variable.
 org.eclipse.debug.core.model.IValue getValue()
           
 void handleDebugEvents(org.eclipse.cdt.debug.core.cdi.event.ICDIEvent[] events)
           
 boolean hasValueChanged()
           
 boolean isArgument()
          Returns whether this variable is an argument.
 boolean isCasted()
          Returns whether this element is casted.
 boolean isEnabled()
          Returns whether this object is enabled.
 void restoreOriginal()
          Restores the original type.
 void setEnabled(boolean enabled)
          Enables/disables this object
 void setValue(org.eclipse.debug.core.model.IValue value)
           
 void setValue(java.lang.String expression)
           
 int sizeof()
           
 boolean supportsFormatting()
          Returns whether this variable supports formatting operations.
 boolean supportsValueModification()
           
 boolean verifyValue(org.eclipse.debug.core.model.IValue value)
           
 boolean verifyValue(java.lang.String expression)
           
 
Methods inherited from class org.eclipse.cdt.debug.internal.core.model.AbstractCVariable
getAdapter
 
Methods inherited from class org.eclipse.cdt.debug.internal.core.model.CDebugElement
createChangeEvent, createCreateEvent, createResumeEvent, createSuspendEvent, createTerminateEvent, fireChangeEvent, fireCreationEvent, fireResumeEvent, fireSuspendEvent, fireTerminateEvent, getCDISession, getCDITarget, getCurrentStateInfo, getDebugTarget, getLaunch, getMessage, getModelIdentifier, getSeverity, getState, isOK, notSupported, requestFailed, requestFailed, targetRequestFailed, targetRequestFailed
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.debug.core.model.IDebugElement
getDebugTarget, getLaunch, getModelIdentifier
 
Methods inherited from interface org.eclipse.cdt.debug.core.model.ICDebugElement
getCurrentStateInfo, getState
 
Methods inherited from interface org.eclipse.debug.core.model.IDebugElement
getDebugTarget, getLaunch, getModelIdentifier
 

Method Detail

getType

public ICType getType()
               throws org.eclipse.debug.core.DebugException
Description copied from interface: ICVariable
Returns the type of this variable.

Specified by:
getType in interface ICVariable
Returns:
the type of this variable
Throws:
org.eclipse.debug.core.DebugException

isEnabled

public boolean isEnabled()
Description copied from interface: IEnableDisableTarget
Returns whether this object is enabled.

Specified by:
isEnabled in interface IEnableDisableTarget
Returns:
true if this obvject is enabled, or false otherwise.

setEnabled

public void setEnabled(boolean enabled)
                throws org.eclipse.debug.core.DebugException
Description copied from interface: IEnableDisableTarget
Enables/disables this object

Specified by:
setEnabled in interface IEnableDisableTarget
Parameters:
enabled - enablement flag value
Throws:
org.eclipse.debug.core.DebugException

canEnableDisable

public boolean canEnableDisable()
Description copied from interface: IEnableDisableTarget
Returns whether this object supports enable/disable operations.

Specified by:
canEnableDisable in interface IEnableDisableTarget
Returns:
whether this object supports enable/disable operations

isArgument

public boolean isArgument()
Description copied from interface: ICVariable
Returns whether this variable is an argument.

Specified by:
isArgument in interface ICVariable
Returns:
whether this variable is an argument

getValue

public org.eclipse.debug.core.model.IValue getValue()
                                             throws org.eclipse.debug.core.DebugException
Specified by:
getValue in interface org.eclipse.debug.core.model.IVariable
Throws:
org.eclipse.debug.core.DebugException

getName

public java.lang.String getName()
                         throws org.eclipse.debug.core.DebugException
Specified by:
getName in interface org.eclipse.debug.core.model.IVariable
Throws:
org.eclipse.debug.core.DebugException

getReferenceTypeName

public java.lang.String getReferenceTypeName()
                                      throws org.eclipse.debug.core.DebugException
Specified by:
getReferenceTypeName in interface org.eclipse.debug.core.model.IVariable
Throws:
org.eclipse.debug.core.DebugException

hasValueChanged

public boolean hasValueChanged()
                        throws org.eclipse.debug.core.DebugException
Specified by:
hasValueChanged in interface org.eclipse.debug.core.model.IVariable
Throws:
org.eclipse.debug.core.DebugException

supportsFormatting

public boolean supportsFormatting()
Description copied from interface: IFormatSupport
Returns whether this variable supports formatting operations.

Specified by:
supportsFormatting in interface IFormatSupport
Returns:
whether this variable supports formatting operations

getFormat

public CVariableFormat getFormat()
Description copied from interface: IFormatSupport
Returns the current format of this variable.

Specified by:
getFormat in interface IFormatSupport
Returns:
the current format of this variable

changeFormat

public void changeFormat(CVariableFormat format)
                  throws org.eclipse.debug.core.DebugException
Description copied from interface: IFormatSupport
Sets the current format of this variable to format.

Specified by:
changeFormat in interface IFormatSupport
Parameters:
format - the new format type
Throws:
org.eclipse.debug.core.DebugException - if this method fails.

canCastToArray

public boolean canCastToArray()
Description copied from interface: ICastToArray
Returns whether this element can be currently casted to array.

Specified by:
canCastToArray in interface ICastToArray
Returns:
whether this element can be currently casted to array

castToArray

public void castToArray(int startIndex,
                        int length)
                 throws org.eclipse.debug.core.DebugException
Description copied from interface: ICastToArray
Performs the casting. The element is transformed to the array of the same type.

Specified by:
castToArray in interface ICastToArray
Parameters:
startIndex - the index of the first element of the array. 0 means that the original element is the first member of the array.
length - tha array size
Throws:
org.eclipse.debug.core.DebugException

setValue

public void setValue(java.lang.String expression)
              throws org.eclipse.debug.core.DebugException
Specified by:
setValue in interface org.eclipse.debug.core.model.IValueModification
Throws:
org.eclipse.debug.core.DebugException

setValue

public void setValue(org.eclipse.debug.core.model.IValue value)
              throws org.eclipse.debug.core.DebugException
Specified by:
setValue in interface org.eclipse.debug.core.model.IValueModification
Throws:
org.eclipse.debug.core.DebugException

supportsValueModification

public boolean supportsValueModification()
Specified by:
supportsValueModification in interface org.eclipse.debug.core.model.IValueModification

verifyValue

public boolean verifyValue(java.lang.String expression)
                    throws org.eclipse.debug.core.DebugException
Specified by:
verifyValue in interface org.eclipse.debug.core.model.IValueModification
Throws:
org.eclipse.debug.core.DebugException

verifyValue

public boolean verifyValue(org.eclipse.debug.core.model.IValue value)
                    throws org.eclipse.debug.core.DebugException
Specified by:
verifyValue in interface org.eclipse.debug.core.model.IValueModification
Throws:
org.eclipse.debug.core.DebugException

canCast

public boolean canCast()
Description copied from interface: ICastToType
Returns whether this element can currently be casted.

Specified by:
canCast in interface ICastToType
Returns:
whether this element can currently be casted

getCurrentType

public java.lang.String getCurrentType()
Description copied from interface: ICastToType
Returns the string presentation of the current type.

Specified by:
getCurrentType in interface ICastToType
Returns:
the string presentation of the current type

cast

public void cast(java.lang.String type)
          throws org.eclipse.debug.core.DebugException
Description copied from interface: ICastToType
Performs the casting to the given type.

Specified by:
cast in interface ICastToType
Parameters:
type - a type to cast to.
Throws:
org.eclipse.debug.core.DebugException

restoreOriginal

public void restoreOriginal()
                     throws org.eclipse.debug.core.DebugException
Description copied from interface: ICastToType
Restores the original type.

Specified by:
restoreOriginal in interface ICastToType
Throws:
org.eclipse.debug.core.DebugException

isCasted

public boolean isCasted()
Description copied from interface: ICastToType
Returns whether this element is casted.

Specified by:
isCasted in interface ICastToType
Returns:
whether this element is casted

handleDebugEvents

public void handleDebugEvents(org.eclipse.cdt.debug.core.cdi.event.ICDIEvent[] events)
Specified by:
handleDebugEvents in interface org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener

dispose

public void dispose()
Specified by:
dispose in class AbstractCVariable

sizeof

public int sizeof()

equals

public boolean equals(java.lang.Object obj)
Compares the original internal variables.

Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

getExpressionString

public java.lang.String getExpressionString()
                                     throws org.eclipse.debug.core.DebugException
Description copied from interface: ICVariable
Returns the text presentation of this variable as an expression.

Specified by:
getExpressionString in interface ICVariable
Returns:
the text presentation of this variable as an expression
Throws:
org.eclipse.debug.core.DebugException