Class AccessCacheGraph

java.lang.Object
org.somox.metrics.util.AccessCacheGraph

public class AccessCacheGraph extends Object
Class used to encapsulate all computations based on the number of accesses between two pairwise GASTClasses
  • Constructor Summary

    Constructors
    Constructor
    Description
    AccessCacheGraph(org.jgrapht.graph.DefaultDirectedGraph<tools.mdsd.jamopp.model.java.classifiers.ConcreteClassifier,ClassAccessGraphEdge> accessGraph)
    Constructor of the access cache
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    calculateNumberOfAccessesToClassesInSet(Set<tools.mdsd.jamopp.model.java.classifiers.ConcreteClassifier> sourceClasses, Set<tools.mdsd.jamopp.model.java.classifiers.ConcreteClassifier> targetClasses)
    Counts all directed accesses from any of the source classes to any of the target classes.
    long
    calculateNumberOfExternalAccesses(Set<tools.mdsd.jamopp.model.java.classifiers.ConcreteClassifier> sourceClasses)
    Calculates the number of outgoing accesses of any class in
    long
    calculateNumberOfIncommingAccesses(Set<tools.mdsd.jamopp.model.java.classifiers.ConcreteClassifier> sourceClasses)
    Compute the number of accesses coming from any class outside and going to the set of classes given
    long
    calculateNumberOfInternalAccesses(Set<tools.mdsd.jamopp.model.java.classifiers.ConcreteClassifier> sourceClasses)
    Calculates the number of inner accesses of any class in

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AccessCacheGraph

      public AccessCacheGraph(org.jgrapht.graph.DefaultDirectedGraph<tools.mdsd.jamopp.model.java.classifiers.ConcreteClassifier,ClassAccessGraphEdge> accessGraph)
      Constructor of the access cache
      Parameters:
      accessGraph - A graph containing as nodes all GASTClasses considered in the Somox run and as edges the number of directed accesses between the two connected classes
  • Method Details

    • calculateNumberOfAccessesToClassesInSet

      public long calculateNumberOfAccessesToClassesInSet(Set<tools.mdsd.jamopp.model.java.classifiers.ConcreteClassifier> sourceClasses, Set<tools.mdsd.jamopp.model.java.classifiers.ConcreteClassifier> targetClasses)
      Counts all directed accesses from any of the source classes to any of the target classes. (Does not consider inverse accesses.)
      Parameters:
      sourceClasses - A set of source classes (nodes in the cache graph)
      targetClasses - A set of target classes (nodes in the cache graph)
      Returns:
      count of accesses The number of total accesses from sourceClasses to targetClasses
    • calculateNumberOfIncommingAccesses

      public long calculateNumberOfIncommingAccesses(Set<tools.mdsd.jamopp.model.java.classifiers.ConcreteClassifier> sourceClasses)
      Compute the number of accesses coming from any class outside and going to the set of classes given
      Parameters:
      sourceClasses - A set of classes for which the incoming accesses are counted
      Returns:
      The total number of incoming accesses to the set of classes
    • calculateNumberOfExternalAccesses

      public long calculateNumberOfExternalAccesses(Set<tools.mdsd.jamopp.model.java.classifiers.ConcreteClassifier> sourceClasses)
      Calculates the number of outgoing accesses of any class in
       sourceClasses
       
      to any class not contained in source classes.
      Parameters:
      sourceClasses - The set of classes
      Returns:
      Count of accesses
    • calculateNumberOfInternalAccesses

      public long calculateNumberOfInternalAccesses(Set<tools.mdsd.jamopp.model.java.classifiers.ConcreteClassifier> sourceClasses)
      Calculates the number of inner accesses of any class in
       sourceClasses
       
      to any class contained in source classes.
      Parameters:
      sourceClasses -
      Returns:
      Count of accesses