Package com.epam.healenium.treecomparing
Class PathFinder
java.lang.Object
com.epam.healenium.treecomparing.PathFinder
public class PathFinder extends Object
-
Constructor Summary
Constructors Constructor Description PathFinder(PathDistance pathDistance, NodeDistance nodeDistance)Creates a path finder which operates certain algorithms of distance by path and by node comparing -
Method Summary
Modifier and Type Method Description List<Scored<Node>>find(Path path, Node newSource, int bestGuessesCount)Finds the list of nodes that most likely are our searched one, ordered by likeness descendingList<Scored<Node>>find(Path path, Node newSource, int bestGuessesCount, double guessCap)Finds the list of nodes that most likely are our searched one, ordered by likeness descendingNodefindNearest(Path path, Node newSource)Finds the nearest node that most likely is our searched one
-
Constructor Details
-
PathFinder
Creates a path finder which operates certain algorithms of distance by path and by node comparing- Parameters:
pathDistance- an algorithm to evaluate node likeness by their pathnodeDistance- an algorithm to evaluate node likeness by content
-
-
Method Details
-
findNearest
Finds the nearest node that most likely is our searched one- Parameters:
path- a collection of nodes that represents the total searched node path; the first node is html tag, the last node is the searched node. We assume that all nodes in the path have their full info.newSource- the parsed DOM of the changed page in which we will look for the searched node- Returns:
- most likely node or null if there isn't any
-
find
Finds the list of nodes that most likely are our searched one, ordered by likeness descending- Parameters:
path- a collection of nodes that represents the total searched node path; the first node is html tag, the last node is the searched node. We assume that all nodes in the path have their full info.newSource- the parsed DOM of the changed page in which we will look for the searched nodebestGuessesCount- the size of the result collection, i.e. the number of similar nodes to return- Returns:
- a list of probably similar nodes, ordered by likeness descending, with the size of bestGuessesCount
-
find
Finds the list of nodes that most likely are our searched one, ordered by likeness descending- Parameters:
path- a collection of nodes that represents the total searched node path; the first node is html tag, the last node is the searched node. We assume that all nodes in the path have their full info.newSource- the parsed DOM of the changed page in which we will look for the searched nodebestGuessesCount- the size of the result collection, i.e. the number of similar nodes to returnguessCap- a min score, that path must exceed to be selected- Returns:
- a list of probably similar nodes, ordered by likeness descending, with the size of bestGuessesCount.
-