|
www.sdmetrics.com | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--sdmetrics.app.DesignComparator
Compare the design metrics for two designs. For instance, two subsequent versions of a model in an iterative development process, or two design alternatives. The two designs must use the same set of metrics and the same set of percentiles. The class maps by name each table of the new design onto a table of the old design. Within each table, each row of the new table is mapped onto a row of the old table.
Use this class as follows:
Controller objects to obtain the metric data
and descriptive statistics of the two designs to compare.
setMappings() to define element mappings
between the two designs to compare.
compareDesigns() with the metric data
and descriptive statistics for the two designs.
DataTable
interface. Rows are the model elements, columns are the metric deltas.
The metric delta tables have an additional column "AD_Status"
added as the last column, with a string to indicate the status of
the design element ("A" for added in the new design, "D" for deleted from
the old design, empty string if the element is present in both designs).
getDeltaDescStats().
| Field Summary | |
static int |
ADDED
Constant indicating an added element/table row. |
static int |
DELETED
Constant indicating a deleted element/table row. |
static java.lang.String |
fids
First line of a element mappings file, for file identification. |
static int |
UNCHANGED
Constant indicating matched element/table row present in both designs. |
| Constructor Summary | |
DesignComparator()
|
|
| Method Summary | |
boolean |
compareDesigns(DataTable om,
DescStats od,
DataTable nm,
DescStats nd)
Perform comparison of two designs. |
int |
elementStatus(int index,
int row)
Return status (added/deleted/matched) of a design element. |
java.lang.String |
getColumnDescription(int index,
int col)
Get the description for a metric in the table. |
java.lang.String |
getColumnName(int index,
int col)
Get the name of a specific metric in the table. |
DataTable |
getDeltaDescStats()
Provide access to descriptive statistics deltas. |
java.lang.String |
getErrorMsg()
Obtain an error description when design comparison has failed. |
int |
getNumberOfColumns(int index)
Get the number of metrics for a metric delta table. |
int |
getNumberOfRows(int index)
Get the number of design elements (rows) on display in a specified table. |
int |
getNumberOfTables()
Returns the number of available tables. |
java.lang.String |
getRowName(int index,
int row)
Get the name of the model element at a specific row. |
java.lang.String |
getTableName(int index)
Returns the name of a table. |
int |
getTypeID(int index)
Return the metamodel type ID of the elements of a table. |
java.lang.Object |
getValueAt(int index,
int row,
int col)
Return the metric delta for a particular design element and metric. |
static void |
loadMappings(java.lang.String filename,
java.util.ArrayList first,
java.util.ArrayList second)
Load an element mapping file. |
static void |
saveMappings(java.lang.String filename,
java.util.ArrayList first,
java.util.ArrayList second)
Save element mappings to a file. |
void |
setMappings(java.util.ArrayList first,
java.util.ArrayList second)
Set user defined element mappings to use for design comparison. |
void |
setRelative(boolean b)
Toggle whether to display absolute or relative metric deltas. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int DELETED
public static final int ADDED
public static final int UNCHANGED
public static final java.lang.String fids
| Constructor Detail |
public DesignComparator()
| Method Detail |
public boolean compareDesigns(DataTable om,
DescStats od,
DataTable nm,
DescStats nd)
DataTable
interface provided by the class. Upon failure, an error description may be
obtained from getErrorMsg(). A failure only occurs if the designs
to compare use different metrics or percentiles.
om - Metric data for first or older design.od - Descriptive statistics for first or older design.nm - Metric data for second or newer design.nd - Descriptive statistics for second or newer design.
true if designs were successfully compared,
false if the designs use different sets of metrics or
percentiles.public DataTable getDeltaDescStats()
public java.lang.String getErrorMsg()
public void setRelative(boolean b)
b - true if relative metric deltas are to be shown, else false.
public void setMappings(java.util.ArrayList first,
java.util.ArrayList second)
first - Element names to map in the first design.second - Element names to map onto in the second design.
public int elementStatus(int index,
int row)
index - Index of the table.row - Row number of the design element.
ADDED if element is only present in the second (newer) design,
DELETED if element is only present in the first (older) design,
UNCHANGED if element is present in both designs.public int getNumberOfTables()
DataTable
getNumberOfTables in interface DataTablepublic java.lang.String getTableName(int index)
DataTable
getTableName in interface DataTableindex - Index of the table to access.
public int getTypeID(int index)
DataTable
getTypeID in interface DataTableindex - Index of the table to access.
public int getNumberOfRows(int index)
getNumberOfRows in interface DataTableindex - Index of the table to access.
public int getNumberOfColumns(int index)
getNumberOfColumns in interface DataTableindex - Index of the table to access.
public java.lang.Object getValueAt(int index,
int row,
int col)
getValueAt in interface DataTableindex - Index of the table to access.row - Index of the row to access.col - Index of the column to access.
public java.lang.String getRowName(int index,
int row)
getRowName in interface DataTableindex - Index of the table to access.row - Index of the row.
public java.lang.String getColumnName(int index,
int col)
getColumnName in interface DataTableindex - Index of the table to access.col - Index of the column.
public java.lang.String getColumnDescription(int index,
int col)
getColumnDescription in interface DataTableindex - Index of the table to access.col - Index of the column.
public static void loadMappings(java.lang.String filename,
java.util.ArrayList first,
java.util.ArrayList second)
throws java.io.IOException
filename - Name of the file to read from.first - Element mappings for the first design are added here.second - Element mappings for the second design are added here.
java.io.IOException - if the file could not be read.
public static void saveMappings(java.lang.String filename,
java.util.ArrayList first,
java.util.ArrayList second)
throws java.io.FileNotFoundException
filename - Name of the file to read from.first - Element mappings for the first design.second - Element mappings for the second design.
java.io.FileNotFoundException - If the file could not be opened for saving.
|
www.sdmetrics.com | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||