Class PrimitiveHierarchy

java.lang.Object
sootup.interceptors.typeresolving.PrimitiveHierarchy

public class PrimitiveHierarchy extends Object
Author:
Zun Wang
  • Constructor Details

    • PrimitiveHierarchy

      public PrimitiveHierarchy()
  • Method Details

    • getLeastCommonAncestor

      @Nonnull public static Collection<Type> getLeastCommonAncestor(@Nonnull Type a, @Nonnull Type b)
      Calculate the least common ancestor of two types(primitive or BottomType). If there's a = b then a is the least common ancestor of a and b; If there's b = a then b is the least common ancestor of a and b; If there are c = a and c = b, but there's no b = a or a = b then c is the least common ancestor of a and b;
    • isAncestor

      public static boolean isAncestor(@Nonnull Type ancestor, @Nonnull Type child)
      Check the ancestor-relationship between two primitive types ancestor and child, namely, whether child can be assigned to ancestor directly to obtain: ancestor = child.
    • arePrimitives

      public static boolean arePrimitives(@Nonnull Type a, @Nonnull Type b)
      Check whether the two given types are primitives or BottomType