/** Returns a list of superclasses of c, including itself. */ public List<SootClass> getSuperclassesOfIncluding(SootClass c) { c.checkLevel(SootClass.HIERARCHY); List<SootClass> l = getSuperclassesOf(c); ArrayList<SootClass> al = new ArrayList<SootClass>(); al.add(c); al.addAll(l); return Collections.unmodifiableList(al); }
/** Returns a list of implementers of c, excluding itself. */ public List<SootClass> getImplementersOf(SootClass i) { i.checkLevel(SootClass.HIERARCHY); if (!i.isInterface()) throw new RuntimeException("interface needed; got " + i); checkState(); Iterator<SootClass> it = getSubinterfacesOfIncluding(i).iterator(); ArraySet set = new ArraySet(); while (it.hasNext()) { SootClass c = it.next(); set.addAll(getDirectImplementersOf(c)); } ArrayList l = new ArrayList(); l.addAll(set); return Collections.unmodifiableList(l); }