Package org.somox.metrics.hierarchy
Class DirectoryMapping
java.lang.Object
org.somox.metrics.abstractmetrics.AbstractMetric
org.somox.metrics.hierarchy.AbstractHierarchyMapping<org.emftext.language.java.containers.Package>
org.somox.metrics.hierarchy.DirectoryMapping
- All Implemented Interfaces:
IMetric
public class DirectoryMapping
extends AbstractHierarchyMapping<org.emftext.language.java.containers.Package>
DirectoryMapping metric: Checks how well are component candidates are arranged in the same or at
least comparable directory.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetMID()
Returns the Metric ID of the Metricprotected org.emftext.language.java.containers.Package
getPath
(org.emftext.language.java.containers.Package element) Return the parent path segment of the passed element Tprotected org.emftext.language.java.containers.Package
getPath
(org.emftext.language.java.types.Type clazz) Return the path segment in the subclasses' meaning of hierarchy where this GAST class is directly attached to.Methods inherited from class org.somox.metrics.hierarchy.AbstractHierarchyMapping
internalComputeDirected, isCommutative, isNormalised
Methods inherited from class org.somox.metrics.abstractmetrics.AbstractMetric
calculateUnion, calculateUnion, checkMetricPostCondition, checkMetricPreCondition, computeDirected, getAccessGraphCache, getComponentToClassHelper, getLaunchConfigurationTab, getMetric, getMetricParameters, initialize
-
Field Details
-
METRIC_ID
-
-
Constructor Details
-
DirectoryMapping
public DirectoryMapping()
-
-
Method Details
-
getMID
Returns the Metric ID of the Metric- Returns:
- the metric id of the instance
-
getPath
protected org.emftext.language.java.containers.Package getPath(org.emftext.language.java.types.Type clazz) Description copied from class:AbstractHierarchyMapping
Return the path segment in the subclasses' meaning of hierarchy where this GAST class is directly attached to. For example, for the directory hierachy, return the directory in which this GAST class is located- Specified by:
getPath
in classAbstractHierarchyMapping<org.emftext.language.java.containers.Package>
- Parameters:
clazz
- The GASTClass for which to retrieve the path segment- Returns:
- The parent of the GASTClass as defined by our subclass or null if this class is not contained in the hierarchy as defined by the subclass
-
getPath
protected org.emftext.language.java.containers.Package getPath(org.emftext.language.java.containers.Package element) Description copied from class:AbstractHierarchyMapping
Return the parent path segment of the passed element T- Specified by:
getPath
in classAbstractHierarchyMapping<org.emftext.language.java.containers.Package>
- Parameters:
element
- The element (i.e. Directory or Package) for which to return the parent (i.e. parent package or parent directory)- Returns:
- The parent if the element or null if there is no parent
-