Overview | Package | Class | Use | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.togethersoft.openapi.sci
Interface SciVariable

All Known Subinterfaces:
  SciAttribute, SciParameter

public interface SciVariable
extends SciElement

Represents source code variable (parameter, attribute, local variable etc.).

This interface has two derivatives: `SciParameter` and `SciAttribute`, which are used to clearly identify whether the variable is a parameter or an attribute.

Author:
  TogetherSoft
See Also: SciParameter, SciAttribute

Method Summary
`boolean` | `canSetInitialValue(SciExpression expr)` Checks whether the specified `SciExpression` can be assigned to this variable as the initial value.
`boolean` | `canSetType(SciType type)` Checks whether the specified type can be set as the type for this variable.
`SciExpression` | `getInitialValue()` Returns `SciExpression` containing the initial value for this variable.
`SciType` | `getType()` Returns a type of this variable.
`void` | `setInitialValue(SciExpression expr)` Sets the initial value for this variable to the specified `SciExpression`.
`void` | `setType(SciType type)` Sets the type for this variable to the specified type.

Methods inherited from interface com.togethersoft.openapi.sci.SciElement
`accept, canSetName, canSetProperty, getDeclarationText, getName, getQualifiedName, getTagList, getUniqueName, hasProperty, isDeleted, isPropertyReadable, isPropertyWritable, setName, setProperty, visitReferences, visitReferences`

Methods inherited from interface com.togethersoft.openapi.sci.SciObject
`canCut, canDelete, canReplace, copy, cut, delete, getContainingFile, getContainingScope, getLanguage, getPositions, getText, getUserProperty, isReadOnly, replace, setUserProperty`

Method Detail

### canSetInitialValue

    public boolean canSetInitialValue(SciExpression expr)

  Checks whether the specified `SciExpression` can be assigned to this variable as the initial value.
  Parameters:
    expr - the `SciExpression` which needs to be assigned to this variable as the initial value
  Returns: `true` if specified `SciExpression` can be assigned to this variable as the initial value, `false` otherwise

### canSetType

    public boolean canSetType(SciType type)

  Checks whether the specified type can be set as the type for this variable. Returns `true` if it can be done, `false` otherwise.
  Parameters:
    type - the type which needs to be assigned to this variable
  Returns: `true` if the specified type can be set as the type for this variable, `false` otherwise

### getInitialValue

    public SciExpression getInitialValue()

  Returns `SciExpression` containing the initial value for this variable.
  Returns: `SciExpression` containing the initial value for this variable
  See Also:
    SciExpression

### getType

    public SciType getType()

  Returns a type of this variable.
  Returns: a type of this variable

### setInitialValue

    public void setInitialValue(SciExpression expr)

  Sets the initial value for this variable to the specified `SciExpression`.
  Parameters:
    expr - the `SciExpression` which needs to be assigned to this variable as the initial value

### setType

    public void setType(SciType type)

  Sets the type for this variable to the specified type. Usually there is no need in this methods, since it is much easier to change a variable's type using the SciType.setText method. For example, if `myAttribute` represents this source code attribute: `

       int k;

  ` then the execution of `

       myAttribute.getType().setText("java.util.Hashtable");

  ` will transform the original attribute into `

       java.util.Hashtable k;

  `
  Parameters:
    type - the type which needs to be assigned to this variable

Overview | Package | Class | Use | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD