Class LocalMember

java.lang.Object
org.glassfish.rmic.tools.java.MemberDefinition
org.glassfish.rmic.tools.tree.LocalMember
All Implemented Interfaces:
Constants, RuntimeConstants

public class LocalMember extends MemberDefinition
A local Field WARNING: The contents of this source file are not part of any supported API. Code that depends on them does so at its own risk: they are subject to change or removal without notice.
  • Field Details

    • number

      int number
      The number of the variable
    • readcount

      int readcount
      Some statistics
    • writecount

      int writecount
    • scopeNumber

      int scopeNumber
      An indication of which block the variable comes from. Helps identify uplevel references.
    • originalOfCopy

      LocalMember originalOfCopy
      Used by copyInline to record the original of this copy.
    • prev

      The previous local variable, this list is used to build a nested context of local variables.
  • Constructor Details

    • LocalMember

      public LocalMember(long where, ClassDefinition clazz, int modifiers, Type type, Identifier name)
      Constructor
    • LocalMember

      public LocalMember(ClassDefinition innerClass)
      Constructor for a block-inner class.
    • LocalMember

      LocalMember(MemberDefinition field)
      Constructor for a proxy to an instance or class variable.
  • Method Details

    • getScopeNumber

      public int getScopeNumber()
      Return current nesting level, i.e., the value of 'scopeNumber'. Made public for the benefit of 'ClassDefinition.resolveName'.
    • getMember

      final MemberDefinition getMember()
      Is this a proxy for the given field?
    • isLocal

      public boolean isLocal()
      Special checks
      Overrides:
      isLocal in class MemberDefinition
    • copyInline

      public LocalMember copyInline(Context ctx)
      Make a copy of this field, which is an argument to a method or constructor. Arrange so that when occurrences of the field are encountered in an immediately following copyInline() operation, the expression nodes will replace the original argument by the fresh copy.
    • getCurrentInlineCopy

      public LocalMember getCurrentInlineCopy(Context ctx)
      Returns the previous result of copyInline(ctx). Must be called in the course of an Expression.copyInline() operation that immediately follows the LocalMember.copyInline(). Return "this" if there is no such copy.
    • copyArguments

      public static LocalMember[] copyArguments(Context ctx, MemberDefinition field)
      May inline copies of all the arguments of the given method.
    • doneWithArguments

      public static void doneWithArguments(Context ctx, LocalMember[] res)
      Call this when finished with the result of a copyArguments() call.
    • isInlineable

      public boolean isInlineable(Environment env, boolean fromFinal)
      Is this local variable's value stable and simple enough to be directly substituted for occurrences of the variable itself? (This decision is made by VarDeclarationStatement.inline().)
      Overrides:
      isInlineable in class MemberDefinition
    • isUsed

      public boolean isUsed()
      Check if used
    • getAccessVar

      LocalMember getAccessVar()
    • setAccessVar

      void setAccessVar(LocalMember f)
    • getAccessVarMember

      MemberDefinition getAccessVarMember()
    • setAccessVarMember

      void setAccessVarMember(MemberDefinition f)
    • getValue

      public Node getValue(Environment env)
      Return value
      Overrides:
      getValue in class MemberDefinition
    • getNumber

      public int getNumber(Context ctx)
      Value number for vsets, or -1 if none.