Class MutableAntiSymmetricPreferenceImpl

    • Method Detail

      • getVoter

        public Voter getVoter()
        Specified by:
        getVoter in interface Preference
        Returns:
        Voter instance of the preference, Returns the voter 0 if no specific voter is associated to this preference
      • getAlternatives

        public Set<Alternative> getAlternatives()
        Description copied from interface: Preference
        The returned set reads through this object: if this object is mutable, any modification to this object modifies the returned set, and conversely.
        Specified by:
        getAlternatives in interface Preference
        Returns:
        alternatives's set
      • asGraph

        public Graph<Alternative> asGraph()
        Description copied from interface: AntiSymmetricPreference
        In the graph : a relation from a to b means "a is at least as good as b". This graph can’t be modified, but is not necessarily immutable. Reflexive and transitive. This graph is anti-symmetric.
        Specified by:
        asGraph in interface AntiSymmetricPreference
        Specified by:
        asGraph in interface Preference
        Returns:
        the Graph corresponding to the Preference
      • asMutableGraph

        public MutableGraph<Alternative> asMutableGraph()
        Description copied from interface: MutableAntiSymmetricPreference
        This graph is not necessarily transitively closed. This method might refuse that an edge be added that would result in the transitive closure violating anti-symmetry, though it will not necessarily check (but it is guaranteed to check if asGraph() has been called previously). If such a situation happens, and is not detected (thus implying that asGraph() has never been called), an exception will be raised the first time asGraph() will be called, unless possibly the transitive closure no more violates anti-symmetry at that time (behavior is undefined in such a case). This graph is irreflexive and may thus be considered as representing a (possibly partly reduced) strict preference relation. The convention that this graph be reflexive would not work: the method nodes().add() would possibly have to create a reflexive edge, which would be surprising.
        Specified by:
        asMutableGraph in interface MutableAntiSymmetricPreference
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object