Class MultipleInheritanceEngine


  • public class MultipleInheritanceEngine
    extends Object
    Resolves ordered multiple inheritance lists, used e.g. in configurations. This only works on names and relations between them. It returns a list of names (all names and aliases are assumed unique).

    Multiple Inheritance Model

    There are many multiple inheritance schemes. This supports linearly order-based inheritance. So this engine gets lists of overrides (unique names) and aliases (unique) and makes a list. It is then up to the calling program to navigate the inheritance order. This allows for an easy solution to the so-called diamond problem which cannot exist here because of the linear ordering.

    Created by Jeff Gaynor
    on 2/2/21 at 6:29 AM

    • Field Detail

      • DEBUG_ON

        public static boolean DEBUG_ON
    • Method Detail

      • isResolutionsRun

        public boolean isResolutionsRun()
        If the resolve method for this class has been run sucessfully.
        Returns:
      • setAtomicNodes

        public void setAtomicNodes​(InheritanceMap atomicNodes)
      • setUnresolvedAliases

        public void setUnresolvedAliases​(InheritanceMap unresolvedAliases)
      • getUnresolvedOverrides

        public InheritanceMap getUnresolvedOverrides()
      • setUnresolvedOverrides

        public void setUnresolvedOverrides​(InheritanceMap unresolvedOverrides)
      • setResolvedAliases

        public void setResolvedAliases​(InheritanceMap resolvedAliases)
      • resolve

        public void resolve()
      • debugPrint

        protected void debugPrint()
      • resolveAlias

        protected void resolveAlias()
      • resolveInhertanceList

        protected InheritanceList resolveInhertanceList​(AliasAndOverrides aao)
        Loops through a list that is not resolved. If every element in the list is resolved, they are replaced with their resolution. If this fails (for instance, there is an unresolved alias on the list) then null is returned. Generally invoke this and if null, skip it.
        Parameters:
        aao -
        Returns:
      • resolveSimpleOverrides

        protected void resolveSimpleOverrides()
      • resolveAliasOverrides

        protected void resolveAliasOverrides()
      • resolveAliasOverrides2

        protected void resolveAliasOverrides2()
        Snoops through the aliases by tracing the known resolved nodes.