|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.vmguys.vmtools.utils.DifferenceFinder2
This class contains methods to compare two JDOM trees and find the differences. It computes the "cost" to convert one tree to the other, and a set of operations to perform the conversion.
The algorithm used is described in Section 3.1 of Tree-to-tree Correction for Document Trees, Technical Report 95-327. The report can be found at
ftp://ftp.qucis.queensu.ca/pub/reports/1995-372.ps
| Constructor Summary | |
DifferenceFinder2()
Constructs a DifferenceFinder2 using the namespace of NO_NAMESPACE. |
|
DifferenceFinder2(org.jdom.Namespace namespace)
Constructs a DifferenceFinder2 with the specified namespace. |
|
DifferenceFinder2(org.jdom.Namespace namespace,
boolean discardWhitespace)
Constructs a Differencefinder with the specified namespace and setting for discardWhitespace. |
|
DifferenceFinder2(org.jdom.Namespace namespace,
boolean discardWhitespace,
boolean addComments)
Constructs a DifferenceFinder2 with the specified namespace, setting for discardWhitespace, and setting for addComments. |
|
| Method Summary | |
CostOps |
findDifferences(DiffElement root1,
DiffElement root2)
Determines what needs to be done to convert the tree rooted at n1 into the tree rooted at n2. |
CostOps |
findDifferences(org.jdom.Element root1,
org.jdom.Element root2)
Same as the other version of findDifferences except for the types of the parameters. |
ProgressReporter |
getProgressReporter()
Returns the current ProgressReporter, or null if there isn't one. |
boolean |
isAddComments()
Getter for property addComments. |
boolean |
isAllowRename()
Getter for property allowRename. |
boolean |
isDiscardWhitespace()
Getter for property discardWhitespace. |
void |
setAddComments(boolean addComments)
Setter for property addComments. |
void |
setAllowRename(boolean allowRename)
Setter for property allowRename. |
void |
setDiscardWhitespace(boolean discardWhitespace)
Setter for property discardWhitespace. |
void |
setProgressReporter(ProgressReporter progressReporter)
This method sets the progress reporter. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DifferenceFinder2()
public DifferenceFinder2(org.jdom.Namespace namespace)
public DifferenceFinder2(org.jdom.Namespace namespace,
boolean discardWhitespace)
public DifferenceFinder2(org.jdom.Namespace namespace,
boolean discardWhitespace,
boolean addComments)
| Method Detail |
public CostOps findDifferences(org.jdom.Element root1,
org.jdom.Element root2)
throws org.jdom.JDOMException
findDifferences(DiffElement, DiffElement)
public CostOps findDifferences(DiffElement root1,
DiffElement root2)
throws org.jdom.JDOMException
Determines what needs to be done to convert the tree rooted at n1 into the tree rooted at n2. Once the minimum cost set of operations has been determined, it is returned to the caller as a CostOps.
public boolean isDiscardWhitespace()
public void setDiscardWhitespace(boolean discardWhitespace)
discardWhitespace - New value of property discardWhitespace.public boolean isAddComments()
public void setAddComments(boolean addComments)
addComments - New value of property addComments.public ProgressReporter getProgressReporter()
public void setProgressReporter(ProgressReporter progressReporter)
public boolean isAllowRename()
public void setAllowRename(boolean allowRename)
allowRename - New value of property allowRename.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||