org.eclipse.cdt.core.dom.ast

## Interface IValue

    public interface IValue

Models a value of a variable, enumerator or expression.

Since:
  5.1

### Method Summary

All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
`IValue` `clone()` Make a deep copy of this value.
`org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation[]` `getAllSubValues()` If this value consists of sub-values, returns an array containing all of them.
`org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation` `getEvaluation()` Returns the evaluation object if this value cannot be represented as a single numerical value, or `null` otherwise.
`default char[]` `getInternalExpression()` Deprecated. Returns an empty character array.
`char[]` `getSignature()` Returns a signature uniquely identifying the value.
`org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation` `getSubValue(int index)` If this value consists of sub-values, returns the sub-value at the given index.
`default IBinding[]` `getUnknownBindings()` Deprecated. Returns an empty array.
`boolean` `isEquivalentTo(IValue other)` Returns true if this value is equivalent to 'other' for declaration matching purposes.
`void` `marshal(org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer buffer)` Serialize this value to the given type marshal buffer.
`int` `numberOfSubValues()` If this value consists of sub-values, returns the number of these sub-values.
`java.lang.Number` `numberValue()` Returns the value as a number, or `null` if it is not possible.
`default java.lang.Long` `numericalValue()` Deprecated. Use numberValue() instead.
`void` `setSubValue(int position, org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation newValue)` If this value consists of sub-values, set the sub-value at the given position to the given new value.

### Method Detail

#### numericalValue

    @Deprecated
    default java.lang.Long numericalValue()

Deprecated. Use numberValue() instead.
Returns the value as a Long number, or `null` if it is not possible.

#### numberValue

    java.lang.Number numberValue()

Returns the value as a number, or `null` if it is not possible.

Since:
  6.2

#### numberOfSubValues

    int numberOfSubValues()

If this value consists of sub-values, returns the number of these sub-values. Otherwise returns 1.

#### getSubValue

    org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation getSubValue(int index)

If this value consists of sub-values, returns the sub-value at the given index. Otherwise, returns this value (represented as an ICPPEvaluation) if the index 0 is passed. EvalFixed.INCOMPLETE is returned if the given index is out of bounds.

#### getAllSubValues

    org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation[] getAllSubValues()

If this value consists of sub-values, returns an array containing all of them. Otherwise, returns an array containing 1 element representing this value. Not all implementations implement this; some may return `null`.

#### getEvaluation

    org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation getEvaluation()

Returns the evaluation object if this value cannot be represented as a single numerical value, or `null` otherwise. This can happen if the value is dependent, or it's a composite value. If `numberValue()` returns `null`, `getEvaluation()` returns not `null` and vice versa.

#### getSignature

    char[] getSignature()

Returns a signature uniquely identifying the value. Two values with identical signatures are guaranteed to be equal.

#### getInternalExpression

    @Deprecated
    default char[] getInternalExpression()

Deprecated. Returns an empty character array.

#### getUnknownBindings

    @Deprecated
    default IBinding[] getUnknownBindings()

Deprecated. Returns an empty array.

#### setSubValue

    void setSubValue(int position,
                     org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPEvaluation newValue)

If this value consists of sub-values, set the sub-value at the given position to the given new value. Otherwise, set this value to the given new value. Not all implementations implement this; for some, a call to this may have no effect.

#### clone

    IValue clone()

Make a deep copy of this value.

Since:
  6.2

#### marshal

    void marshal(org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer buffer)
          throws CoreException

Serialize this value to the given type marshal buffer.

Throws:
  `CoreException`

#### isEquivalentTo

    boolean isEquivalentTo(IValue other)

Returns true if this value is equivalent to 'other' for declaration matching purposes.