Package org.codehaus.groovy.transform.tailrec

# Class UsedVariableTracker

java.lang.Object
org.codehaus.groovy.transform.tailrec.UsedVariableTracker

All Implemented Interfaces:
  `VariableReplacedListener`

public class UsedVariableTracker extends Object implements VariableReplacedListener
Tracks replacement variables that are actually used while rewriting expressions.

- ## Field Summary

  ### Fields inherited from interface org.codehaus.groovy.transform.tailrec.VariableReplacedListener

  `NULL`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `UsedVariableTracker()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Set<String>`
  `getUsedVariableNames()`
  Returns the names of replacement variables that were referenced.
  `void`
  `variableReplaced(VariableExpression oldVar, VariableExpression newVar)`
  Called after a variable expression has been replaced.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### UsedVariableTracker

    public UsedVariableTracker()

- ## Method Details

  - ### variableReplaced

    public void variableReplaced(VariableExpression oldVar, VariableExpression newVar)
    Called after a variable expression has been replaced.
    Specified by:
      `variableReplaced` in interface `VariableReplacedListener`
    Parameters:
      `oldVar` - the original variable expression
      `newVar` - the replacement variable expression

  - ### getUsedVariableNames

    public Set<String> getUsedVariableNames()
    Returns the names of replacement variables that were referenced.
    Returns:
      the used replacement variable names