Class NodeConnection

  • All Implemented Interfaces:
    de.unirostock.sems.xmlutils.comparison.Connection

    public class NodeConnection
    extends Object
    implements de.unirostock.sems.xmlutils.comparison.Connection
    Author:
    Martin Scharm
    • Constructor Summary

      Constructors 
      Constructor Description
      NodeConnection​(NodeConnection toCopy)
      Instantiates a new connection as a copy of toCopy.
      NodeConnection​(de.unirostock.sems.xmlutils.ds.TreeNode a, de.unirostock.sems.xmlutils.ds.TreeNode b)
      Instantiates a new connection, implicitly setting the weight to 1.
      NodeConnection​(de.unirostock.sems.xmlutils.ds.TreeNode a, de.unirostock.sems.xmlutils.ds.TreeNode b, double weight)
      Instantiates a new connection, explicitly defining a weight.
    • Constructor Detail

      • NodeConnection

        public NodeConnection​(de.unirostock.sems.xmlutils.ds.TreeNode a,
                              de.unirostock.sems.xmlutils.ds.TreeNode b)
        Instantiates a new connection, implicitly setting the weight to 1.
        Parameters:
        a - the node of tree 1
        b - the node of tree 2
      • NodeConnection

        public NodeConnection​(NodeConnection toCopy)
        Instantiates a new connection as a copy of toCopy.
        Parameters:
        toCopy - the connection to copy
      • NodeConnection

        public NodeConnection​(de.unirostock.sems.xmlutils.ds.TreeNode a,
                              de.unirostock.sems.xmlutils.ds.TreeNode b,
                              double weight)
        Instantiates a new connection, explicitly defining a weight.
        Parameters:
        a - the node of tree 1
        b - the node of tree 2
        weight - the weight of this connection
    • Method Detail

      • getAnnotations

        public List<Map.Entry<org.apache.jena.rdf.model.Property,​org.apache.jena.rdf.model.RDFNode>> getAnnotations()
        Gets the annotations of this mapping. The annotation list is a list of predicates and objects.
        Returns:
        the annotations
      • addAnnotation

        public void addAnnotation​(org.apache.jena.rdf.model.Property predicate,
                                  org.apache.jena.rdf.model.RDFNode object)
        Adds an annotation describing this node connection.
        Parameters:
        predicate - the predicate that relates to an object
        object - the actual object describing this element
      • getTreeA

        public de.unirostock.sems.xmlutils.ds.TreeNode getTreeA()
        Gets the corresponding node in tree a.
        Specified by:
        getTreeA in interface de.unirostock.sems.xmlutils.comparison.Connection
        Returns:
        the node in tree a
      • getTreeB

        public de.unirostock.sems.xmlutils.ds.TreeNode getTreeB()
        Gets the corresponding node in tree b.
        Specified by:
        getTreeB in interface de.unirostock.sems.xmlutils.comparison.Connection
        Returns:
        the node in tree b
      • setWeight

        public void setWeight​(double u)
        Specified by:
        setWeight in interface de.unirostock.sems.xmlutils.comparison.Connection
      • addWeight

        public void addWeight​(double u)
        Specified by:
        addWeight in interface de.unirostock.sems.xmlutils.comparison.Connection
      • scaleWeight

        public void scaleWeight​(double u)
        Specified by:
        scaleWeight in interface de.unirostock.sems.xmlutils.comparison.Connection
      • getWeight

        public double getWeight()
        Specified by:
        getWeight in interface de.unirostock.sems.xmlutils.comparison.Connection
      • getPartnerOf

        public de.unirostock.sems.xmlutils.ds.TreeNode getPartnerOf​(de.unirostock.sems.xmlutils.ds.TreeNode node)
        Specified by:
        getPartnerOf in interface de.unirostock.sems.xmlutils.comparison.Connection