|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.xqhs.graphs.matcher.GraphMatcherQuick
net.xqhs.graphs.matchingPlatform.GraphMatcherPersistent
public class GraphMatcherPersistent
The class extends GraphMatcherQuick
(and therefore implements GraphMatchingProcess
) to handle
persistent matching -- matching in which the graph changes slightly from time to time. With each change, only
affected matches should be removed or created.
The pattern is not allowed to change.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.xqhs.graphs.matcher.GraphMatcherQuick |
---|
GraphMatcherQuick.EdgeComparator, GraphMatcherQuick.MatchSingleComparator |
Field Summary | |
---|---|
protected java.util.Map<Edge,java.util.Set<Match>> |
eMatchIndex
An index containing the matches that contain each graph edge. |
protected java.util.Map<Edge,java.util.Set<Match>> |
ePMatchIndex
An index containing the matches that contain each pattern edge. |
protected java.util.SortedSet<Match> |
sortedMatches
THe set of all matches, sorted by k (lowest k first). |
Fields inherited from class net.xqhs.graphs.matcher.GraphMatcherQuick |
---|
allMatches, graph, initialState, kThreshold, matchIterator, matchQueue, monitor, pattern |
Constructor Summary | |
---|---|
protected |
GraphMatcherPersistent(Graph graph,
GraphPattern pattern)
Creates a new matcher for the specified graph and pattern. |
Method Summary | |
---|---|
protected Match |
addInitialMatch(Edge e,
Edge eP,
java.lang.String matchID)
Create a single-edge match and add it to the matching queue; also add matches from the queue to its merge candidate list (as well as adding the match to other matches' merge candidates) |
GraphMatcherPersistent |
addMatches(Edge e)
The method should be called for each new edge added to the graph. |
protected Match |
addMergeMatch(Match m1,
Match m2)
Merges two matches into one. |
GraphMatcherPersistent |
clearData()
Clears the match queue and the list of all matches. |
GraphMatcherPersistent |
completeMatches()
Completes the matching process, growing all matches to their maximum coverage. |
static GraphMatcherPersistent |
getMatcher(Graph graph,
GraphPattern pattern,
MonitorPack monitoring)
Returns a newly created GraphMatcherQuick instance for the specified graph and pattern. |
protected int |
getMemory()
|
GraphMatcherPersistent |
initializeMatching()
Initializes the matching progress, by creating the match comparator and adding the initial matches to the match queue. |
GraphMatcherPersistent |
removeMatches(Edge edge)
The method should be called for each edge removed from the graph. |
Methods inherited from class net.xqhs.graphs.matcher.GraphMatcherQuick |
---|
addInitialMatches, computeVertexDistances, getAllCompleteMatches, getAllMatches, getBestMatches, getNextMatch, growMatches, initializeMatchQueue, invalidateMatch, isMatch, resetIterator, resetIterator, setMonitor, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.SortedSet<Match> sortedMatches
protected java.util.Map<Edge,java.util.Set<Match>> eMatchIndex
protected java.util.Map<Edge,java.util.Set<Match>> ePMatchIndex
Constructor Detail |
---|
protected GraphMatcherPersistent(Graph graph, GraphPattern pattern)
addMatches(Edge)
and removeMatches(Edge)
.
graph
- - the graph.pattern
- - the pattern.Method Detail |
---|
public GraphMatcherPersistent initializeMatching()
GraphMatcherQuick
initializeMatching
in class GraphMatcherQuick
public GraphMatcherPersistent clearData()
GraphMatcherQuick
clearData
in interface GraphMatchingProcess
clearData
in class GraphMatcherQuick
public GraphMatcherPersistent completeMatches()
public GraphMatcherPersistent addMatches(Edge e)
The method creates the initial matches containing the new edge, adds their merge candidates, but does not grow
any matches. This can be requested through any of the match retrieval methods or by calling
completeMatches()
.
e
- - the new edge added to the graph.
public GraphMatcherPersistent removeMatches(Edge edge)
The method only removes the edge from the edge → matches index, and marks the matches containing the edge as invalid. Whenever an iteration finds the invalidated match, it will be removed from the containing collection. This saves a large number of operations that would have been required by looping through the various lists and indexes.
edge
- - the edge removed from the graph.
protected Match addInitialMatch(Edge e, Edge eP, java.lang.String matchID)
GraphMatcherQuick
addInitialMatch
in class GraphMatcherQuick
e
- - the edge in the graph.eP
- - the edge in the pattern.matchID
- - the id for the new match.
protected Match addMergeMatch(Match m1, Match m2)
GraphMatcherQuick
Matches are expected to be disjoint, both as GmP and as G' (in terms of edges); also, all common nodes in GmP
must correspond to the same nodes in G' (this check should be done in addMatcheToQueue
.
Attention: matches are expected to be merge-able without checks.
addMergeMatch
in class GraphMatcherQuick
m1
- - the first match.m2
- - the second match.
public static GraphMatcherPersistent getMatcher(Graph graph, GraphPattern pattern, MonitorPack monitoring)
GraphMatcherQuick
instance for the specified graph and pattern.
graph
- - the graph.pattern
- - the pattern.monitoring
- - the monitoring instance. It must not be null
but it can be a newly created instance
with no configuration.
GraphMatcherQuick
instance.
java.lang.IllegalArgumentException
- if the monitoring
argument is null
.protected int getMemory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |