Package org.apache.bcel.util

Examples of org.apache.bcel.util.ClassQueue


    /**
     * Get all interfaces implemented by this JavaClass (transitively).
     */
    public JavaClass[] getAllInterfaces() throws ClassNotFoundException {
        ClassQueue queue = new ClassQueue();
        Set allInterfaces = new TreeSet();
        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 (JavaClass[]) allInterfaces.toArray(new JavaClass[allInterfaces.size()]);
    }
View Full Code Here


  public static final String[]  IGNORED    = { "java[.].*", "javax[.].*", "sun[.].*", "sunw[.].*",
      "com[.]sun[.].*", "org[.]omg[.].*", "org[.]w3c[.].*", "org[.]xml[.].*", "net[.]jini[.].*" };

  public TransitiveHull(JavaClass clazz) {
    _queue = new ClassQueue();
    _queue.enqueue(clazz);
    _set = new ClassSet();
    _set.add(clazz);
  }
View Full Code Here

  /**
   * 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();
  }
View Full Code Here

  /**
   * Get all interfaces implemented by this JavaClass (transitively).
   */
  public JavaClass[] getAllInterfaces() {
    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();
  }
View Full Code Here

    /**
     * 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()]);
    }
View Full Code Here

TOP

Related Classes of org.apache.bcel.util.ClassQueue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.