com.ibm.dtfj.analyzer.util
Class ImageCompare

java.lang.Object
  extended by com.ibm.dtfj.analyzer.util.ImageCompare

public class ImageCompare
extends java.lang.Object

Support for comparing DTFJ images to report the differences. At present this is really aimed at verifying that two images contain the same contents but may be derived to allow more detailed comparisons.


Constructor Summary
ImageCompare()
          Build a comparator to compare a pair of images.
ImageCompare(IAnalysisReport report)
          Build a comparator to compare a pair of images.
ImageCompare(java.io.PrintStream out)
          Build a comparator to compare a pair of images.
 
Method Summary
 int compare(com.ibm.dtfj.image.ImageAddressSpace v1, com.ibm.dtfj.image.ImageAddressSpace v2, boolean deep)
          Compare two ImageAddresSpaces and report the differences
 int compare(com.ibm.dtfj.image.Image v1, com.ibm.dtfj.image.Image v2, boolean deep)
           
 int compare(com.ibm.dtfj.image.ImageModule v1, com.ibm.dtfj.image.ImageModule v2, boolean deep)
          Compare two ImageModules and report the differences
 int compare(com.ibm.dtfj.image.ImagePointer v1, com.ibm.dtfj.image.ImagePointer v2, java.lang.String msg)
          Compare two ImagePointers and report the differences
 int compare(com.ibm.dtfj.image.ImageProcess v1, com.ibm.dtfj.image.ImageProcess v2, boolean deep)
          Compare two ImageProcesses and report the differences
 int compare(com.ibm.dtfj.image.ImageRegister v1, com.ibm.dtfj.image.ImageRegister v2, boolean deep)
          Compare two ImageRegisters and report the differences
 int compare(com.ibm.dtfj.image.ImageSection v1, com.ibm.dtfj.image.ImageSection v2, boolean deep)
          Compare two ImageSections and report the differences
 int compare(com.ibm.dtfj.image.ImageStackFrame v1, com.ibm.dtfj.image.ImageStackFrame v2, boolean deep)
          Compare two ImageStackFrames and report the differences
 int compare(com.ibm.dtfj.image.ImageSymbol v1, com.ibm.dtfj.image.ImageSymbol v2, boolean deep)
          Compare two ImageSymbols and report the differences
 int compare(com.ibm.dtfj.image.ImageThread v1, com.ibm.dtfj.image.ImageThread v2, boolean deep)
          Compare two ImageThreads and report the differences
 int compare(java.util.Iterator v1, java.util.Iterator v2, boolean deep, java.lang.String msg, boolean sort)
          Compare the objects in two iterators and report the differences
 int compare(com.ibm.dtfj.java.JavaClass v1, com.ibm.dtfj.java.JavaClass v2, boolean deep)
          Compare two JavaClasses and report the differences
 int compare(com.ibm.dtfj.java.JavaClassLoader v1, com.ibm.dtfj.java.JavaClassLoader v2, boolean deep)
          Compare two JavaClassLoaders and report the differences
 int compare(com.ibm.dtfj.java.JavaField v1, com.ibm.dtfj.java.JavaField v2, boolean deep)
          Compare two JavaFields and report the differences
 int compare(com.ibm.dtfj.java.JavaHeap v1, com.ibm.dtfj.java.JavaHeap v2, boolean deep)
          Compare two JavaHeaps and report the differences
 int compare(com.ibm.dtfj.java.JavaLocation v1, com.ibm.dtfj.java.JavaLocation v2, boolean deep)
          Compare two JavaLocations and report the differences
 int compare(com.ibm.dtfj.java.JavaMethod v1, com.ibm.dtfj.java.JavaMethod v2, boolean deep)
          Compare two JavaMethods and report the differences
 int compare(com.ibm.dtfj.java.JavaMonitor v1, com.ibm.dtfj.java.JavaMonitor v2, boolean deep)
          Compare two JavaMonitors and report the differences
 int compare(com.ibm.dtfj.java.JavaObject v1, com.ibm.dtfj.java.JavaObject v2, boolean deep)
          Compare two JavaObjects and report the differences
 int compare(com.ibm.dtfj.java.JavaRuntime v1, com.ibm.dtfj.java.JavaRuntime v2, boolean deep)
          Compare two JavaRuntimes and report the differences
 int compare(com.ibm.dtfj.java.JavaStackFrame v1, com.ibm.dtfj.java.JavaStackFrame v2, boolean deep)
          Compare two JavaStackFrames and report the differences
 int compare(com.ibm.dtfj.java.JavaThread v1, com.ibm.dtfj.java.JavaThread v2, boolean deep)
          Compare two JavaThreads and report the differences
 int compare(com.ibm.dtfj.java.JavaVMOption v1, com.ibm.dtfj.java.JavaVMOption v2, boolean deep)
          Compare two JavaVMOptions and report the differences
 int compare(com.ibm.dtfj.runtime.ManagedRuntime v1, com.ibm.dtfj.runtime.ManagedRuntime v2, boolean deep)
          Compare two ManagedRuntimes and report the differences
 java.lang.String getID(java.lang.Object obj1)
          Build a short identifier for an object.
protected  void outputDifference(java.lang.String msg)
           
protected  void outputDifference(java.lang.String msg, java.lang.String msg1)
           
 void setErrorLimit(int limit)
          Define the maximum number of errors that will be reported.
protected  void show(java.lang.String msg)
           
protected  void show(java.lang.String field, int value)
           
 void summarise()
          Summarise the differences and matches either to the output stream or the report.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageCompare

public ImageCompare()
Build a comparator to compare a pair of images.


ImageCompare

public ImageCompare(IAnalysisReport report)
Build a comparator to compare a pair of images. Any differences are added to the given report.

Parameters:
report - the report to receive the difference information

ImageCompare

public ImageCompare(java.io.PrintStream out)
Build a comparator to compare a pair of images. Any differences are added to the given report.

Parameters:
out - the stream to receive the difference information
Method Detail

setErrorLimit

public void setErrorLimit(int limit)
Define the maximum number of errors that will be reported.

Parameters:
limit - the maximum number of errors

outputDifference

protected void outputDifference(java.lang.String msg,
                                java.lang.String msg1)

outputDifference

protected void outputDifference(java.lang.String msg)

show

protected void show(java.lang.String msg)

show

protected void show(java.lang.String field,
                    int value)

summarise

public void summarise()
Summarise the differences and matches either to the output stream or the report.


compare

public int compare(com.ibm.dtfj.image.Image v1,
                   com.ibm.dtfj.image.Image v2,
                   boolean deep)
Parameters:
v1 -
v2 -
deep -
Returns:
differences

compare

public int compare(com.ibm.dtfj.image.ImageAddressSpace v1,
                   com.ibm.dtfj.image.ImageAddressSpace v2,
                   boolean deep)
Compare two ImageAddresSpaces and report the differences

Parameters:
v1 - first address space
v2 - second address space
deep - should we do a deep compare against contained objects ?
Returns:
differences

compare

public int compare(com.ibm.dtfj.image.ImagePointer v1,
                   com.ibm.dtfj.image.ImagePointer v2,
                   java.lang.String msg)
Compare two ImagePointers and report the differences

Parameters:
v1 - first pointer
v2 - second pointer
msg - message to print on error
Returns:
differences

compare

public int compare(com.ibm.dtfj.image.ImageProcess v1,
                   com.ibm.dtfj.image.ImageProcess v2,
                   boolean deep)
Compare two ImageProcesses and report the differences

Parameters:
v1 - first process
v2 - second process
deep - should we do a deep compare against contained objects ?
Returns:
differences

compare

public int compare(com.ibm.dtfj.image.ImageSection v1,
                   com.ibm.dtfj.image.ImageSection v2,
                   boolean deep)
Compare two ImageSections and report the differences

Parameters:
v1 - first section
v2 - second section
deep - should we do a deep compare against contained objects ?
Returns:
differences

compare

public int compare(com.ibm.dtfj.image.ImageModule v1,
                   com.ibm.dtfj.image.ImageModule v2,
                   boolean deep)
Compare two ImageModules and report the differences

Parameters:
v1 - first module
v2 - second module
deep - should we do a deep compare against contained objects ?
Returns:
differences

compare

public int compare(com.ibm.dtfj.image.ImageThread v1,
                   com.ibm.dtfj.image.ImageThread v2,
                   boolean deep)
Compare two ImageThreads and report the differences

Parameters:
v1 - first thread
v2 - second thread
deep - should we do a deep compare against contained objects ?
Returns:
differences

compare

public int compare(com.ibm.dtfj.image.ImageSymbol v1,
                   com.ibm.dtfj.image.ImageSymbol v2,
                   boolean deep)
Compare two ImageSymbols and report the differences

Parameters:
v1 - first symbol
v2 - second symbol
deep - should we do a deep compare against contained objects ?
Returns:
differences

compare

public int compare(com.ibm.dtfj.image.ImageStackFrame v1,
                   com.ibm.dtfj.image.ImageStackFrame v2,
                   boolean deep)
Compare two ImageStackFrames and report the differences

Parameters:
v1 - first frame
v2 - second frame
deep - should we do a deep compare against contained objects ?
Returns:
differences

compare

public int compare(com.ibm.dtfj.image.ImageRegister v1,
                   com.ibm.dtfj.image.ImageRegister v2,
                   boolean deep)
Compare two ImageRegisters and report the differences

Parameters:
v1 - first register
v2 - second register
deep - should we do a deep compare against contained objects ?
Returns:
differences

compare

public int compare(com.ibm.dtfj.runtime.ManagedRuntime v1,
                   com.ibm.dtfj.runtime.ManagedRuntime v2,
                   boolean deep)
Compare two ManagedRuntimes and report the differences

Parameters:
v1 - first runtime
v2 - second runtime
deep - should we do a deep compare against contained objects ?
Returns:
differences

compare

public int compare(com.ibm.dtfj.java.JavaRuntime v1,
                   com.ibm.dtfj.java.JavaRuntime v2,
                   boolean deep)
Compare two JavaRuntimes and report the differences

Parameters:
v1 - first runtime
v2 - second runtime
deep - should we do a deep compare against contained objects ?
Returns:
differences

compare

public int compare(com.ibm.dtfj.java.JavaStackFrame v1,
                   com.ibm.dtfj.java.JavaStackFrame v2,
                   boolean deep)
Compare two JavaStackFrames and report the differences

Parameters:
v1 - first frame
v2 - second frame
deep - should we do a deep compare against contained objects ?
Returns:
differences

compare

public int compare(com.ibm.dtfj.java.JavaLocation v1,
                   com.ibm.dtfj.java.JavaLocation v2,
                   boolean deep)
Compare two JavaLocations and report the differences

Parameters:
v1 - first location
v2 - second location
deep - should we do a deep compare against contained objects ?
Returns:
differences

compare

public int compare(com.ibm.dtfj.java.JavaClass v1,
                   com.ibm.dtfj.java.JavaClass v2,
                   boolean deep)
Compare two JavaClasses and report the differences

Parameters:
v1 - first class
v2 - second class
deep - should we do a deep compare against contained objects ?
Returns:
differences

compare

public int compare(com.ibm.dtfj.java.JavaClassLoader v1,
                   com.ibm.dtfj.java.JavaClassLoader v2,
                   boolean deep)
Compare two JavaClassLoaders and report the differences

Parameters:
v1 - first loader
v2 - second loader
deep - should we do a deep compare against contained objects ?
Returns:
differences

compare

public int compare(com.ibm.dtfj.java.JavaThread v1,
                   com.ibm.dtfj.java.JavaThread v2,
                   boolean deep)
Compare two JavaThreads and report the differences

Parameters:
v1 - first thread
v2 - second thread
deep - should we do a deep compare against contained objects ?
Returns:
differences

compare

public int compare(com.ibm.dtfj.java.JavaObject v1,
                   com.ibm.dtfj.java.JavaObject v2,
                   boolean deep)
Compare two JavaObjects and report the differences

Parameters:
v1 - first object
v2 - second object
deep - should we do a deep compare against contained objects ?
Returns:
differences

compare

public int compare(com.ibm.dtfj.java.JavaMonitor v1,
                   com.ibm.dtfj.java.JavaMonitor v2,
                   boolean deep)
Compare two JavaMonitors and report the differences

Parameters:
v1 - first monitor
v2 - second monitor
deep - should we do a deep compare against contained objects ?
Returns:
differences

compare

public int compare(com.ibm.dtfj.java.JavaHeap v1,
                   com.ibm.dtfj.java.JavaHeap v2,
                   boolean deep)
Compare two JavaHeaps and report the differences

Parameters:
v1 - first heap
v2 - second heap
deep - should we do a deep compare against contained objects ?
Returns:
differences

compare

public int compare(com.ibm.dtfj.java.JavaMethod v1,
                   com.ibm.dtfj.java.JavaMethod v2,
                   boolean deep)
Compare two JavaMethods and report the differences

Parameters:
v1 - first method
v2 - second method
deep - should we do a deep compare against contained objects ?
Returns:
differences

compare

public int compare(com.ibm.dtfj.java.JavaField v1,
                   com.ibm.dtfj.java.JavaField v2,
                   boolean deep)
Compare two JavaFields and report the differences

Parameters:
v1 - first field
v2 - second field
deep - should we do a deep compare against contained objects ?
Returns:
differences

compare

public int compare(com.ibm.dtfj.java.JavaVMOption v1,
                   com.ibm.dtfj.java.JavaVMOption v2,
                   boolean deep)
Compare two JavaVMOptions and report the differences

Parameters:
v1 - first option
v2 - second option
deep - should we do a deep compare against contained objects ?
Returns:
differences

getID

public java.lang.String getID(java.lang.Object obj1)
Build a short identifier for an object.

Parameters:
obj1 - the object to get an ID from
Returns:
the string ID

compare

public int compare(java.util.Iterator v1,
                   java.util.Iterator v2,
                   boolean deep,
                   java.lang.String msg,
                   boolean sort)
Compare the objects in two iterators and report the differences

Parameters:
v1 - the first set of objects
v2 - the second set of objects
deep - should we do a deep compare against contained objects ?
msg - message to print with the difference
sort - if true then sort the iterators
Returns:
differences


© Copyright IBM Corp. 2007, 2008 All Rights Reserved. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.