org.pf.tools.cda.core.dependency.analyzer
Class WorksetAnalyzer

java.lang.Object
  extended by org.pf.tools.cda.core.dependency.analyzer.WorksetAnalyzer

public class WorksetAnalyzer
extends java.lang.Object

This singleton can be used to do various analyzing which runs over the elements contained in a given workset.

Version:
1.1
Author:
M.Duchrow

Method Summary
 void addAllDerivedElements(java.util.Collection result, ClassInformation classInfo)
          Looks in the workset of the given class for all classes that directly or indirectly extend the given class.
 void addAllSuperclassesAndInterfaces(java.util.Collection result, ClassInformation classInfo)
          Adds superclasses and all extended or implemented interfaces the hierarchy upwards or the specified class to the given result collection.
 ClassInformation[] findAllDerivedElements(ClassInformation classInfo)
          Looks in the workset of the given class for all classes that directly or indirectly extend the given class.
 ClassInformation[] findAllSuperclassesAndInterfaces(ClassInformation classInfo)
          Returns an array containing all superclasses and interfaces of the given class.
 ClassInformation[] findWholeHierarchy(ClassInformation classInfo)
          Returns an array containing all classes and interfaces that are in the inheritance hierarchy of the given class.
static WorksetAnalyzer instance()
          Returns the only instance this class supports (design pattern "Singleton")
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static WorksetAnalyzer instance()
Returns the only instance this class supports (design pattern "Singleton")


findWholeHierarchy

public ClassInformation[] findWholeHierarchy(ClassInformation classInfo)
Returns an array containing all classes and interfaces that are in the inheritance hierarchy of the given class. The given class itself is not included in the result array.


addAllDerivedElements

public void addAllDerivedElements(java.util.Collection result,
                                  ClassInformation classInfo)
Looks in the workset of the given class for all classes that directly or indirectly extend the given class. That also includes all direct or indirect implementors of an interface if the given classInfo represents such an interface. All found subclasses/subinterfaces will be added to the given result collection.

Parameters:
result - The collection to which the found elements will be added (must not be null)
classInfo - The class/interface of which the derived elements are looked up

findAllDerivedElements

public ClassInformation[] findAllDerivedElements(ClassInformation classInfo)
Looks in the workset of the given class for all classes that directly or indirectly extend the given class. That also includes all direct or indirect implementors of an interface if the given classInfo represents such an interface.

Parameters:
classInfo - The class/interface of which the derived elements are looked up
Returns:
An array of the derived classes/interfaces

addAllSuperclassesAndInterfaces

public void addAllSuperclassesAndInterfaces(java.util.Collection result,
                                            ClassInformation classInfo)
Adds superclasses and all extended or implemented interfaces the hierarchy upwards or the specified class to the given result collection.


findAllSuperclassesAndInterfaces

public ClassInformation[] findAllSuperclassesAndInterfaces(ClassInformation classInfo)
Returns an array containing all superclasses and interfaces of the given class.