Interface IMetric

All Known Implementing Classes:
AbstractComposedMetric, AbstractCountingMetric, AbstractHierarchyMapping, AbstractMetric, Abstractness, AbstractRatioMetric, AbstractStepwiseMetric, AbstractTypesCount, AbstractWeightedComposedMetric, AdherenceToInterfaceCommunication, AfferentCoupling, ConfigurableRatioMetric, ConfigurableStepwiseMetric, ConfigurableWeightedComposedMetric, Coupling, DefaultCompositionIndicatingMetric, DefaultMergeIndicatingMetric, DirectoryMapping, DMS, EfferentCoupling, ExternalAccessesCount, Instability, InterfaceAccessesCount, InternalAccessesCount, NameResemblance, PackageMapping, SliceLayerArchitectureQuality, SubsystemComponent, TotalTypesCount

public interface IMetric
Base interface for all SoMoX metrics.
  • Method Details

    • computeDirected

      void computeDirected(ClusteringRelation relationToCompute)
      Computes the metric for the given clustering relation and stores the value in it
    • isCommutative

      boolean isCommutative()
      Returns:
      true if the metric gives the same result if firstComponent and secondComponent are swapped
    • isNormalised

      boolean isNormalised()
      Returns:
      whether the metric is normalized. If it is normalized, values of this metric must be between 0.0 and 1.0.
    • initialize

      void initialize(Root gastModel, SoMoXConfiguration somoxConfiguration, Map<MetricID,IMetric> allMetrics, org.jgrapht.DirectedGraph<org.emftext.language.java.classifiers.ConcreteClassifier,ClassAccessGraphEdge> accessGraph, ComponentToImplementingClassesHelper componentToClassHelper)
      Initializes the Metric. Must be called before metrics are computed. Should be called again, if the model changed
      Parameters:
      gastModel - the Root object of the GAST model
      somoxConfiguration - the configuration of the metric computation
      allMetrics - A map of all metrics available in the running SoMoX instance, maps metricID to Metric implementation
      accessGraph - A graph which contains the number of accesses from the source GASTClass to the target GASTClass for all edges in the
      componentToClassHelper - Helper initialized graph
    • getLaunchConfigurationTab

      MetricTab getLaunchConfigurationTab()
      Returns the GUI launch configuration tab that can be used to configure the metric. Override if the metric supplies a tab
    • getMID

      MetricID getMID()
      Returns the Metric ID of the Metric
      Returns:
      the metric id of the instance
    • getMetricParameters

      ParameterDescriptor[] getMetricParameters()
      The parameters needed by this metric for its computation. Parameters will be shown on the UI and their values will be passed to the metric during initialization of the metric
      Returns:
      A list of parameter descriptors for the parameters of this metric