Class ClassAncestryHelper


  • public class ClassAncestryHelper
    extends Object
    Helper class for receiving information about EClass inheritance
    • Method Detail

      • getLeastCommonAncestor

        public static org.eclipse.emf.ecore.EClass getLeastCommonAncestor​(Collection<org.eclipse.emf.ecore.EClass> classes)
        Get the least common ancestor of a collection of classes
        Parameters:
        classes - - collection of classes
        Returns:
        - least common ancestor
      • getLeastCommonAncestor

        public static org.eclipse.emf.ecore.EClass getLeastCommonAncestor​(org.eclipse.emf.ecore.EClass classA,
                                                                          org.eclipse.emf.ecore.EClass classB)
        Get the least common ancestor of two classes
        Parameters:
        classA - - first class
        classB - - second class
        Returns:
        least common ancestor
      • isAncestor

        public static boolean isAncestor​(org.eclipse.emf.ecore.EClass classA,
                                         org.eclipse.emf.ecore.EClass classB)
        Decide whether the second class is an ancestor of the first class
        Parameters:
        classA - First class
        classB - Second class
        Returns:
        true if the second class is an ancestor of the first class, false otherwise
      • getCommonSuperClass

        public static org.eclipse.emf.ecore.EClass getCommonSuperClass​(Collection<org.eclipse.emf.ecore.EObject> elements)
        Calculate the common super class of a list of instances
        Parameters:
        elements - List of instances
        Returns:
        Common super class