public class DiffFinder extends Object
Modifier and Type | Class and Description |
---|---|
class |
DiffFinder.PairComparator |
class |
DiffFinder.PairComparator2 |
Modifier | Constructor and Description |
---|---|
protected |
DiffFinder() |
|
DiffFinder(ElementIdentity eID) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkAttributesEqual(Element p1,
Element p2) |
protected List<Change.Type> |
checkChange(Node p1,
Node p2) |
protected List<Change.Type> |
checkChange(Node n1,
Node n2,
int p1,
int p2) |
protected boolean |
checkTokensEqual(Node p1,
Node p2) |
protected void |
compareChildren(List<Node> ancestors1,
List<Node> ancestors2,
List<Difference> deList) |
protected boolean |
compareText(Text n1,
Text n2) |
protected boolean |
compareTextByValue(Text n1,
Text n2) |
protected boolean |
compareTokenEquals(List<Token> t1List,
List<Token> t2List) |
protected boolean |
compareWhiteSpaces(Text n1,
Text n2) |
protected Difference |
createAddEvent(List<Node> ancestors1,
Node n,
int absolutePos,
List<Node> ancestors2) |
protected Difference |
createChangeEvent(List<Node> ancestors1,
Node n1,
Node n2,
int n1Pos,
int n2Pos,
List<Change.Type> changes,
List<Node> ancestors2) |
protected Difference |
createDeleteEvent(List<Node> ancestors1,
Node n,
int pos,
List<Node> ancestors2) |
static List<Difference> |
filterWhitespace(List<Difference> deList) |
List<Difference> |
findDiff(Document d1,
Document d2) |
protected Node |
findMatch(Element child,
List<Node> childNodes,
Node parent1) |
protected Node |
findMatch(Text child,
List<Node> childNodes) |
List<Difference> |
findOptimized(List<Difference> deList) |
protected List<Node> |
getChildList(Node parent) |
static NodeInfo.NodeType |
getNodeType(Node child) |
static List<Node> |
getPathToRoot(Node node) |
static boolean |
isPossibleWhiteSpace(String text) |
static boolean |
isWhiteSpaceOnly(Text txt) |
protected void |
markAdd(List<Node> ancestors1,
Node n,
int absolutePos,
int posFromSibling,
Node siblingBefore,
List<Node> ancestors2,
List<Difference> deList) |
protected void |
markChange(List<Node> ancestors1,
Node n1,
Node n2,
int n1Pos,
int n2Pos,
List<Change.Type> changes,
List<Node> ancestors2,
List<Difference> deList) |
protected void |
markDelete(List<Node> ancestors1,
Node n,
int pos,
Node siblingBefore,
List<Node> ancestors2,
List<Difference> deList) |
protected void |
modifyPositionFromIndex(int index,
List<Difference> childDeList,
Difference de,
HashMap<Difference,Integer> oldPosMap) |
protected DiffFinder()
public DiffFinder(ElementIdentity eID)
public List<Difference> findDiff(Document d1, Document d2)
protected void compareChildren(List<Node> ancestors1, List<Node> ancestors2, List<Difference> deList)
public static NodeInfo.NodeType getNodeType(Node child) throws DOMException
DOMException
protected List<Change.Type> checkChange(Node n1, Node n2, int p1, int p2)
protected List<Change.Type> checkChange(Node p1, Node p2)
protected Difference createAddEvent(List<Node> ancestors1, Node n, int absolutePos, List<Node> ancestors2)
protected Difference createDeleteEvent(List<Node> ancestors1, Node n, int pos, List<Node> ancestors2)
protected Difference createChangeEvent(List<Node> ancestors1, Node n1, Node n2, int n1Pos, int n2Pos, List<Change.Type> changes, List<Node> ancestors2)
protected void markAdd(List<Node> ancestors1, Node n, int absolutePos, int posFromSibling, Node siblingBefore, List<Node> ancestors2, List<Difference> deList)
protected void markDelete(List<Node> ancestors1, Node n, int pos, Node siblingBefore, List<Node> ancestors2, List<Difference> deList)
protected void markChange(List<Node> ancestors1, Node n1, Node n2, int n1Pos, int n2Pos, List<Change.Type> changes, List<Node> ancestors2, List<Difference> deList)
public static List<Difference> filterWhitespace(List<Difference> deList)
public List<Difference> findOptimized(List<Difference> deList)
protected void modifyPositionFromIndex(int index, List<Difference> childDeList, Difference de, HashMap<Difference,Integer> oldPosMap)
public static boolean isPossibleWhiteSpace(String text)
public static boolean isWhiteSpaceOnly(Text txt)