|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sofya.graphs.irg.IRG
public class IRG
Class which represents an Interclass Relation Graph for a given set of Java classes, as described by Orso, Shi, and Harrold (Scaling Regression Testing to Large Software Systems), extended to additionally support Java interfaces. This is effectively a class hierarchy graph which supports the modeling of class relationships introduced by the semantics of Java interfaces.
IRGHandler
Nested Class Summary | |
---|---|
static class |
IRG.ClassNode
This class represents a node in the IRG which encapsulates the interclass relations for a particular class. |
Field Summary | |
---|---|
static java.lang.String |
BASE_ID
Identifier returned if the superclass is requested for the primordial class ( java.lang.Object ). |
static int |
MAX_NAME_TABLE_SIZE
Maximum number of entries permitted in the name table. |
static int |
NO_SUPERCLASS
Special index indicating that a class has no superclass. |
static java.lang.String |
UNDEF_ID
Identifier returned if the superclass is requested for a class outside of the set of classes for which the IRG was constructed. |
Constructor Summary | |
---|---|
IRG(java.util.List classList)
Constructs an interclass relation graph from a list of classes. |
|
IRG(java.util.List classList,
boolean findUses)
Constructs an interclass relation graph from a list of classes. |
|
IRG(java.lang.String progFile,
java.lang.String tag)
Constructs an interclass relation graph from the list of classes specified by the given ' .prog ' file. |
Method Summary | |
---|---|
protected void |
buildIRG(java.util.List classList)
Builds the interclass relation graph. |
IRG.ClassNode |
getClassRelationData(java.lang.String className)
Gets the node containing the interclass relations for a given class. |
java.lang.String[] |
getNameTable()
Gets a copy of the name/index table. |
static void |
main(java.lang.String[] argv)
Test driver for the IRG class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NO_SUPERCLASS
java.lang.Object
(interfaces
support direct multiple inheritance, thus subinterfaces do not
have direct references to their superinterfaces in the graph. They
do however implement their superinterface(s), so they appear in
their superinterfaces' implementors list(s)).
public static final int MAX_NAME_TABLE_SIZE
public static final java.lang.String BASE_ID
java.lang.Object
).
public static final java.lang.String UNDEF_ID
Constructor Detail |
---|
public IRG(java.lang.String progFile, java.lang.String tag) throws java.io.FileNotFoundException, java.io.IOException, java.lang.ClassFormatError
.prog
' file.
progFile
- A '.prog
' file in the
database containing the list of classes for which the graph
is to be built.tag
- Database tag associated with the file. May be
null
, in which case the file is assumed to be
located in the root database directory.
java.io.FileNotFoundException
- If a class named in the 'prog'
file cannot be found.
java.io.IOException
- If an error occurs while attempting to read an
input class for analysis.
java.lang.ClassFormatError
- If an input class is not a valid Java class.public IRG(java.util.List classList) throws java.io.IOException, java.lang.ClassFormatError
classList
- List of classes for which to construct an interclass
relation graph.
java.io.IOException
- If an error occurs while attempting to read an
input class for analysis.
java.lang.ClassFormatError
- If an input class is not a valid Java class.public IRG(java.util.List classList, boolean findUses) throws java.io.IOException, java.lang.ClassFormatError
classList
- List of classes for which to construct an interclass
relation graph.findUses
- Flag specifying whether to compute used classes in
the graph. Setting to true
makes the IRG consistent with
the data structure described by Orso, Shi, and Harrold.
java.io.IOException
- If an error occurs while attempting to read an
input class for analysis.
java.lang.ClassFormatError
- If an input class is not a valid Java class.Method Detail |
---|
protected void buildIRG(java.util.List classList) throws java.io.IOException, java.lang.ClassFormatError
classList
- List of fully qualified class names from which the
IRG will be built. Class relationship data will only be computed for
those classes found in this list, although superclasses
'external' to the list will be properly identified.
java.io.IOException
- If an error occurs while attempting to read an
input class for analysis.
java.lang.ClassFormatError
- If an input class is not a valid Java class.public java.lang.String[] getNameTable()
This method is intended primarily for use by
IRGHandler
.
public IRG.ClassNode getClassRelationData(java.lang.String className) throws java.lang.ClassNotFoundException
className
- Name of the class for which the interclass relations
data node is to be retrieved.
java.lang.ClassNotFoundException
- If no node can be found in the IRG for
the specified class.public static void main(java.lang.String[] argv) throws java.lang.Exception
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |