Class ClassHierarchyStore
java.lang.Object
com.ibm.wala.shrike.shrikeBT.analysis.ClassHierarchyStore
- All Implemented Interfaces:
ClassHierarchyProvider
This implementation of ClassHierarchyProvider is a simple writable data structure representing a
class hierarchy. You call setClassInfo to record information about a class.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
containsClass
(String cl) String[]
getSubClasses
(String cl) getSuperClass
(String cl) String[]
int
isInterface
(String cl) Iterate through all classes in the store.void
Delete the class information from the store.void
setClassInfo
(String cl, boolean isInterface, boolean isFinal, String superClass, String[] superInterfaces) Append some class information to the store.
-
Constructor Details
-
ClassHierarchyStore
public ClassHierarchyStore()Create an empty store.
-
-
Method Details
-
containsClass
-
setClassInfo
public void setClassInfo(String cl, boolean isInterface, boolean isFinal, String superClass, String[] superInterfaces) throws IllegalArgumentException Append some class information to the store.- Parameters:
cl
- the JVM type of the class being added (e.g., Ljava/lang/Object;)isInterface
- true iff it's an interfaceisFinal
- true iff it's finalsuperClass
- the JVM type of the superclass, or null if this is ObjectsuperInterfaces
- the JVM types of its implemented interfaces- Throws:
IllegalArgumentException
-
removeClassInfo
Delete the class information from the store. -
iterateOverClasses
-
getSuperClass
- Specified by:
getSuperClass
in interfaceClassHierarchyProvider
- Returns:
- the superclass of the given class, or null if the superclass is not known or cl is java.lang.Object
-
getSuperInterfaces
- Specified by:
getSuperInterfaces
in interfaceClassHierarchyProvider
- Returns:
- the superinterfaces of the given class, or null if they are not known
-
getSubClasses
- Specified by:
getSubClasses
in interfaceClassHierarchyProvider
- Returns:
- the complete set of direct subclasses or implementors of cl, or null if the complete set is not known
-
isInterface
- Specified by:
isInterface
in interfaceClassHierarchyProvider
- Returns:
- whether or not cl is an interface, or Constants.MAYBE if not known
-