Interface IClassHierarchy

    • Method Detail

      • addClass

        boolean addClass​(IClass klass)
        Returns:
        true if the add succeeded; false if it failed for some reason
        Throws:
        IllegalArgumentException - if klass is null
      • getNumberOfClasses

        int getNumberOfClasses()
        Returns:
        The number of classes present in the class hierarchy.
      • isRootClass

        boolean isRootClass​(IClass c)
      • getRootClass

        IClass getRootClass()
      • getNumber

        int getNumber​(IClass c)
      • getUnresolvedClasses

        Set<TypeReference> getUnresolvedClasses()
        BEGIN Custom change: remember unresolved classes
      • getPossibleTargets

        Set<IMethod> getPossibleTargets​(MethodReference ref)
        Find the possible targets of a call to a method reference
        Parameters:
        ref - method reference
        Returns:
        the set of IMethods that this call can resolve to.
        Throws:
        IllegalArgumentException - if ref is null
      • getPossibleTargets

        Set<IMethod> getPossibleTargets​(IClass receiverClass,
                                        MethodReference ref)
        Find the possible targets of a call to a method reference where the receiver is of a certain type
        Parameters:
        receiverClass - the class of the receiver
        ref - method reference
        Returns:
        the set of IMethods that this call can resolve to.
      • resolveMethod

        IMethod resolveMethod​(MethodReference m)
        Return the unique receiver of an invocation of method on an object of type m.getDeclaredClass
        Returns:
        IMethod, or null if no appropriate receiver is found.
        Throws:
        IllegalArgumentException - if m is null
      • resolveMethod

        IMethod resolveMethod​(IClass receiverClass,
                              Selector selector)
        Return the unique receiver of an invocation of method on an object of type declaringClass
        Parameters:
        receiverClass - type of receiver
        selector - method signature
        Returns:
        Method resolved method abstraction
        Throws:
        IllegalArgumentException - if receiverClass is null
      • implementsInterface

        boolean implementsInterface​(IClass c,
                                    IClass i)
        Does c implement i?
        Returns:
        true iff i is an interface and c is a class that implements i, or c is an interface that extends i.
      • getJavaLangErrorTypes

        Collection<TypeReference> getJavaLangErrorTypes()
        Solely for optimization; return a Collection representing the subclasses of Error kind of ugly. a better scheme?
      • getJavaLangRuntimeExceptionTypes

        Collection<TypeReference> getJavaLangRuntimeExceptionTypes()
        Solely for optimization; return a Collection representing the subclasses of RuntimeException kind of ugly. a better scheme?
      • getImplementors

        Set<IClass> getImplementors​(TypeReference type)
        Parameters:
        type - an interface
        Returns:
        Set of IClass that represent implementors of the interface
      • getNumberOfImmediateSubclasses

        int getNumberOfImmediateSubclasses​(IClass klass)
        Returns:
        the number of classes that immediately extend klass.
      • getImmediateSubclasses

        Collection<IClass> getImmediateSubclasses​(IClass klass)
        Returns:
        the classes that immediately extend klass.