Class AbstractMIEdge<T>

  • All Implemented Interfaces:
    MIEdge<T>
    Direct Known Subclasses:
    BindingPair

    public abstract class AbstractMIEdge<T>
    extends Object
    implements MIEdge<T>
    Abstract class for MIEdge interface. Node A and node B are sorted according to a provided comparator. Equals and hashCode are overridden so an edge is equals if nodeA and nodeB are the same and mutable. The MIComparator will be used to sort node A and B, to test if two objects are identical in the equals method and to generate hashCode for node A and B. (A-B is the same as B-A)
    Since:
    14/11/13
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • AbstractMIEdge

        public AbstractMIEdge​(T nodeA,
                              T nodeB,
                              MIComparator<T> nodeComparator)

        Constructor for AbstractMIEdge.

        Parameters:
        nodeA - a T object.
        nodeB - a T object.
        nodeComparator - a MIComparator object.
    • Method Detail

      • getNodeA

        public T getNodeA()

        Getter for the field nodeA.

        Specified by:
        getNodeA in interface MIEdge<T>
        Returns:
        a T object.
      • getNodeB

        public T getNodeB()

        Getter for the field nodeB.

        Specified by:
        getNodeB in interface MIEdge<T>
        Returns:
        a T object.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object