/**
* Get all interfaces implemented by this JavaClass (transitively).
*/
public JavaClass[] getAllInterfaces() throws ClassNotFoundException {
ClassQueue queue = new ClassQueue();
Set<JavaClass> allInterfaces = new TreeSet<JavaClass>();
queue.enqueue(this);
while (!queue.empty()) {
JavaClass clazz = queue.dequeue();
JavaClass souper = clazz.getSuperClass();
JavaClass[] _interfaces = clazz.getInterfaces();
if (clazz.isInterface()) {
allInterfaces.add(clazz);
} else {
if (souper != null) {
queue.enqueue(souper);
}
}
for (int i = 0; i < _interfaces.length; i++) {
queue.enqueue(_interfaces[i]);
}
}
return allInterfaces.toArray(new JavaClass[allInterfaces.size()]);
}