Class NameResemblance

java.lang.Object
org.somox.metrics.abstractmetrics.AbstractMetric
org.somox.metrics.naming.NameResemblance
All Implemented Interfaces:
IMetric

public class NameResemblance extends AbstractMetric
NameResemblance metric. Counts for all Types in any of the two component candidates the similar names and divides it by the total amount of names. The names are trimmed before they are compared, i.e., their prefixes and suffixes are removed as configured on this metric's configuration tab.
  • Field Details

    • METRIC_ID

      public static final MetricID METRIC_ID
  • Constructor Details

    • NameResemblance

      public NameResemblance()
  • Method Details

    • initialize

      public void initialize(Root gastModel, SoMoXConfiguration somoxConfiguration, Map<MetricID,IMetric> allMetrics, org.jgrapht.graph.DefaultDirectedGraph<tools.mdsd.jamopp.model.java.classifiers.ConcreteClassifier,ClassAccessGraphEdge> accessGraph, ComponentToImplementingClassesHelper componentToImplementingClassesHelper)
      Description copied from interface: IMetric
      Initializes the Metric. Must be called before metrics are computed. Should be called again, if the model changed
      Specified by:
      initialize in interface IMetric
      Overrides:
      initialize in class AbstractMetric
      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
      componentToImplementingClassesHelper - Helper initialized graph
    • internalComputeDirected

      protected void internalComputeDirected(ClusteringRelation relationToCompute)
      Template method to be implemented by subclasses to effectively compute the metric value
      Specified by:
      internalComputeDirected in class AbstractMetric
      Parameters:
      relationToCompute - The relation to compute
    • isCommutative

      public boolean isCommutative()
      Specified by:
      isCommutative in interface IMetric
      Specified by:
      isCommutative in class AbstractMetric
      Returns:
      true if the metric gives the same result if firstComponent and secondComponent are swapped
    • getLaunchConfigurationTab

      public MetricTab getLaunchConfigurationTab()
      Returns the GUI launch configuration tab that can be used to configure the metric. Override if the metric supplies a tab
      Specified by:
      getLaunchConfigurationTab in interface IMetric
      Overrides:
      getLaunchConfigurationTab in class AbstractMetric
    • getMID

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

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