Class UnambiguousCuratedInteractionBaseComparator

  • All Implemented Interfaces:
    Comparator<Interaction>

    public class UnambiguousCuratedInteractionBaseComparator
    extends CuratedInteractionBaseComparator
    Unambiguous comparator for curated interactions.

    It will first compare the basic properties of an interaction using UnambiguousInteractionBaseComparator. Then it will compare the created dates (null created dates always come after) Finally it will compare the updated date (null updated date always come after)

    Since:
    31/05/13
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • UnambiguousCuratedInteractionBaseComparator

        public UnambiguousCuratedInteractionBaseComparator()

        Constructor for UnambiguousCuratedInteractionBaseComparator.

    • Method Detail

      • areEquals

        public static boolean areEquals​(Interaction interaction1,
                                        Interaction interaction2)
        Use UnambiguousCuratedInteractionBaseComparator to know if two interactions are equals.
        Parameters:
        interaction1 - a Interaction object.
        interaction2 - a Interaction object.
        Returns:
        true if the two interactions are equal
      • hashCode

        public static int hashCode​(Interaction interaction)

        hashCode

        Parameters:
        interaction - a Interaction object.
        Returns:
        the hashcode consistent with the equals method for this comparator
      • compare

        public int compare​(Interaction interaction1,
                           Interaction interaction2)
        It will first compare the basic properties of an interaction using AbstractInteractionBaseComparator. Then it will compare the created dates (null created dates always come after) Finally it will compare the updated date (null updated date always come after) It will first compare the basic properties of an interaction using UnambiguousInteractionBaseComparator. Then it will compare the created dates (null created dates always come after) Finally it will compare the updated date (null updated date always come after)
        Specified by:
        compare in interface Comparator<Interaction>
        Overrides:
        compare in class CuratedInteractionBaseComparator
        Parameters:
        interaction1 - a Interaction object.
        interaction2 - a Interaction object.
        Returns:
        a int.