Class Connector
- java.lang.Object
-
- de.unirostock.sems.bives.algorithm.Connector
-
- Direct Known Subclasses:
IdConnector
,LabelConnector
,XyDiffConnector
public abstract class Connector extends Object
The Class Connector, intended to find node-correspondences between two trees.- Author:
- Martin Scharm
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
allowDifferentIds
Are mappings of nodes with different ids allowed? seeDiff.ALLOW_DIFFERENT_IDS
protected boolean
careAboutNames
Do we care about names? seeDiff.CARE_ABOUT_NAMES
protected SimpleConnectionManager
conMgmt
The connection manager, holding node-mappings.protected de.unirostock.sems.xmlutils.ds.TreeDocument
docA
The original document.protected de.unirostock.sems.xmlutils.ds.TreeDocument
docB
The modified document.protected boolean
stricterNames
Should we handle names very strictly? seeDiff.STRICTER_NAMES
-
Constructor Summary
Constructors Constructor Description Connector(de.unirostock.sems.xmlutils.ds.TreeDocument docA, de.unirostock.sems.xmlutils.ds.TreeDocument docB)
Instantiates a new connector.Connector(de.unirostock.sems.xmlutils.ds.TreeDocument docA, de.unirostock.sems.xmlutils.ds.TreeDocument docB, boolean allowDifferentIds, boolean careAboutNames, boolean stricterNames)
Instantiates a new connector.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
connect()
Inherit to search for connections.void
findConnections()
Find connections between nodes of both versions of your document.SimpleConnectionManager
getConnections()
Gets the connections.de.unirostock.sems.xmlutils.ds.TreeDocument
getDocA()
Gets the original document.de.unirostock.sems.xmlutils.ds.TreeDocument
getDocB()
Gets the modified document.protected abstract void
init()
Initializes the extension.protected boolean
nodeAssign(de.unirostock.sems.xmlutils.ds.TreeNode a, de.unirostock.sems.xmlutils.ds.TreeNode b)
Assign two nodes to each other, as long as they don't have a connection.
-
-
-
Field Detail
-
allowDifferentIds
protected boolean allowDifferentIds
Are mappings of nodes with different ids allowed? seeDiff.ALLOW_DIFFERENT_IDS
-
careAboutNames
protected boolean careAboutNames
Do we care about names? seeDiff.CARE_ABOUT_NAMES
-
stricterNames
protected boolean stricterNames
Should we handle names very strictly? seeDiff.STRICTER_NAMES
-
conMgmt
protected SimpleConnectionManager conMgmt
The connection manager, holding node-mappings.
-
docA
protected de.unirostock.sems.xmlutils.ds.TreeDocument docA
The original document.
-
docB
protected de.unirostock.sems.xmlutils.ds.TreeDocument docB
The modified document.
-
-
Constructor Detail
-
Connector
public Connector(de.unirostock.sems.xmlutils.ds.TreeDocument docA, de.unirostock.sems.xmlutils.ds.TreeDocument docB, boolean allowDifferentIds, boolean careAboutNames, boolean stricterNames)
Instantiates a new connector.- Parameters:
docA
- the original documentdocB
- the modified documentallowDifferentIds
- may mapped entities have different ids? seeDiff.ALLOW_DIFFERENT_IDS
careAboutNames
- should we care about names? seeDiff.CARE_ABOUT_NAMES
stricterNames
- should we handle the names very strictly? seeDiff.STRICTER_NAMES
-
Connector
public Connector(de.unirostock.sems.xmlutils.ds.TreeDocument docA, de.unirostock.sems.xmlutils.ds.TreeDocument docB)
Instantiates a new connector. Uses default values for the mapping, seeDiff.ALLOW_DIFFERENT_IDS
,Diff.CARE_ABOUT_NAMES
, andDiff.STRICTER_NAMES
.- Parameters:
docA
- the original documentdocB
- the modified document
-
-
Method Detail
-
getDocA
public de.unirostock.sems.xmlutils.ds.TreeDocument getDocA()
Gets the original document.- Returns:
- the original document
-
getDocB
public de.unirostock.sems.xmlutils.ds.TreeDocument getDocB()
Gets the modified document.- Returns:
- the modified document
-
init
protected abstract void init() throws BivesConnectionException
Initializes the extension.- Throws:
BivesConnectionException
- the bives connection exception
-
connect
protected abstract void connect() throws BivesConnectionException
Inherit to search for connections.- Throws:
BivesConnectionException
- the bives connection exception
-
findConnections
public final void findConnections() throws BivesConnectionException
Find connections between nodes of both versions of your document.- Throws:
BivesConnectionException
- the bives connection exception
-
getConnections
public final SimpleConnectionManager getConnections()
Gets the connections.- Returns:
- the connections
-
nodeAssign
protected boolean nodeAssign(de.unirostock.sems.xmlutils.ds.TreeNode a, de.unirostock.sems.xmlutils.ds.TreeNode b) throws BivesConnectionException
Assign two nodes to each other, as long as they don't have a connection.- Parameters:
a
- the node from the original treeb
- the node from the modified tree- Returns:
- true, if successfully connected
- Throws:
BivesConnectionException
- the bives connection exception
-
-