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