Class EntityStack

java.lang.Object
fr.inria.verveine.extractor.java.utils.EntityStack

public class EntityStack extends Object
A stack of FAMIX Entities so that we know in what container each new Entity is declared
  • Field Details

  • Constructor Details

    • EntityStack

      public EntityStack()
  • Method Details

    • clearTypes

      public void clearTypes()
      Empties the context stack of Famix classes
    • getLastAccess

      public TAccess getLastAccess()
    • setLastAccess

      public void setLastAccess(TAccess lastAccess)
    • getLastReference

      public TReference getLastReference()
    • setLastReference

      public void setLastReference(TReference lastReference)
    • getLastInvocation

      public TInvocation getLastInvocation()
    • setLastInvocation

      public void setLastInvocation(TInvocation invok)
    • push

      public void push(TNamedEntity e)
      Pushes an entity on top of the "context stack"
      Parameters:
      e - -- the entity
    • pushPckg

      public void pushPckg(TPackage e)
      Sets the Famix Package on top of the "context stack"
      Parameters:
      e - -- the Famix Package
    • pushType

      public void pushType(TType t)
      Pushes a Famix Type on top of the "context type stack"
      Parameters:
      t - -- the FamixType
    • pushMethod

      public void pushMethod(TMethod e)
      Pushes a Famix method on top of the "context stack" for the current Famix Type Adds also a special entity to hold the metrics for the method
      Parameters:
      e - -- the Famix method
    • pushBehaviouralEntity

      public void pushBehaviouralEntity(TMethod e)
      Pushes a Famix BehaviouralEntity on top of the "context stack" Adds also a special entity to hold the metrics for the BehaviouralEntity
      Parameters:
      e - -- the Famix BehaviouralEntity
    • pushAnnotationMember

      public void pushAnnotationMember(TAnnotationTypeAttribute fmx)
    • clearPckg

      public void clearPckg()
      Empties the context stack of package and associated classes
    • pop

      public TNamedEntity pop()
    • popPckg

      public TPackage popPckg()
      Removes and returns the Famix package from the "context stack" Also empties the class stack (which was presumably associated to this package) Note: does not check that there is such a namespace
      Returns:
      the Famix method
    • popType

      public TType popType()
      Pops the top Famix type from the "context stack"
      Note: does not check that there is such a type, so could possibly throw an EmptyStackException
      Returns:
      the Famix class
    • popMethod

      public TMethod popMethod()
      Pops the top Famix method of the current class on top of the "context stack" Note: does not check that there is such a class or method, so could possibly throw an Exception
      Returns:
      the Famix method
    • popAnnotationMember

      public TAnnotationTypeAttribute popAnnotationMember()
    • top

      public TNamedEntity top()
      Returns the Famix entity on top of the "context stack" Note: does not check that there is such an entity
      Returns:
      the Famix entity
    • topPckg

      public TPackage topPckg()
      Returns the Famix package on top of the "context stack" Note: does not check that there is such a package
      Returns:
      the Famix namespace
    • topType

      public TType topType()
      Returns the Famix type on top of the "context stack" Note: does not check that there is such a class, so could possibly throw an EmptyStackException
      Returns:
      the Famix class
    • topBehaviouralEntity

      public TMethod topBehaviouralEntity()
      Returns the Famix BehaviouralEntity on top of the "context stack" Note: does not check that there is such a BehaviouralEntity, so could possibly throw an EmptyStackException
      Returns:
      the Famix BehaviouralEntity
    • topMethod

      public TMethod topMethod()
      Returns the Famix method of the Famix class on top of the "context stack" Note: does not check that there is such a class or method, so could possibly throw an EmptyStackException
      Returns:
      the Famix method
    • topAnnotationMember

      public TAnnotationTypeAttribute topAnnotationMember()
    • getTopMethodCyclo

      public int getTopMethodCyclo()
      Returns the Cyclomatic complexity of the Famix Method on top of the context stack
    • getTopMethodNOS

      public int getTopMethodNOS()
      Returns the Number of Statements of the Famix Method on top of the context stack
    • setTopMethodCyclo

      public void setTopMethodCyclo(int c)
      Sets the Cyclomatic complexity of the Famix Method on top of the context stack
    • setTopMethodNOS

      public void setTopMethodNOS(int n)
      Sets to the Number of Statements of the Famix Method on top of the context stack
    • addTopMethodCyclo

      public void addTopMethodCyclo(int c)
      Adds to the Cyclomatic complexity of the Famix Method on top of the context stack
    • addTopMethodNOS

      public void addTopMethodNOS(int n)
      Adds to the Number of Statements of the Famix Method on top of the context stack