Package: org.codehaus.groovy.ast.expr

## [Java] Class PrefixExpression

- org.codehaus.groovy.ast.expr.PrefixExpression

-     public class PrefixExpression
      extends Expression

  Represents a prefix unary expression like `++i` or `--value`. The operation is applied to the expression before the value is used.

  Examples:

  - `++counter` - increment counter and return new value
  - `--index` - decrement index and return new value
  See Also:
    for post-increment/post-decrement operators
    UnaryMinusExpression
    UnaryPlusExpression

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class Expression` | `EMPTY_ARRAY`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `PrefixExpression(Token operation, Expression expression)` Creates a prefix expression.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Expression` | `getExpression()` Returns the expression being modified by the prefix operation.
    `` | `public Token` | `getOperation()` Returns the operator token.
    `` | `public String` | `getText()` Returns a string representation of this prefix expression.
    `` | `public ClassNode` | `getType()` Returns the type of this prefix expression, which is the type of the operand.
    `` | `public void` | `setExpression(Expression expression)` Sets the expression to apply the prefix operation to.
    `` | `public String` | `toString()` Returns a debug string representation.
    `` | `public Expression` | `transformExpression(ExpressionTransformer transformer)` Transforms this expression by applying the given transformer to the inner expression, creating a new prefix expression with the transformed operand.
    `` | `public void` | `visit(GroovyCodeVisitor visitor)` Accepts a GroovyCodeVisitor using the visitor pattern.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Expression` | `getType, setType, transformExpression, transformExpressions, transformExpressions`
    `class AnnotatedNode` | `addAnnotation, addAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, getGroovydoc, getInstance, hasNoRealSourcePosition, isSynthetic, setDeclaringClass, setHasNoRealSourcePosition, setSynthetic`
    `class ASTNode` | `copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getText, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setMetaDataMap, setSourcePosition, visit`

- - ### Constructor Detail

    - #### public PrefixExpression(Token operation, Expression expression)

      Creates a prefix expression.

      Parameters:
        `operation` - the operator token (`++` or `--`)
        `expression` - the expression to apply the operation to

  - ### Method Detail

    - #### public Expression getExpression()

      Returns the expression being modified by the prefix operation.

      Returns:
        the expression

    - #### public Token getOperation()

      Returns the operator token.

      Returns:
        the `++` or `--` token

    - #### public String getText()

      Returns a string representation of this prefix expression.

      Returns:
        the text representation, e.g., "(++foo)"

    - #### public ClassNode getType()

      Returns the type of this prefix expression, which is the type of the operand.

      Returns:
        the type of the inner expression

    - #### public void setExpression(Expression expression)

      Sets the expression to apply the prefix operation to.

      Parameters:
        `expression` - the expression, typically a variable or property

    - #### public String toString()

      Returns a debug string representation.

      Returns:
        a string like "PrefixExpression[++foo]"

    - #### public Expression transformExpression(ExpressionTransformer transformer)

      Transforms this expression by applying the given transformer to the inner expression, creating a new prefix expression with the transformed operand.

      Parameters:
        `transformer` - the ExpressionTransformer to apply
      Returns:
        a new prefix expression with transformed inner expression

    - #### public void visit(GroovyCodeVisitor visitor)

      Accepts a GroovyCodeVisitor using the visitor pattern.

      Parameters:
        `visitor` - the visitor to accept