Class OldLinearPreferenceImpl


  • public class OldLinearPreferenceImpl
    extends OldCompletePreferenceImpl
    This class is immutable Contains a list of Alternatives sorted by preferences Two alternatives can't be equally ranked You can't store the same alternative several times in the list Every alternative is an integer and corresponds to a voting choice
    • Method Detail

      • getAlternatives

        public List<Alternative> getAlternatives()
        Returns:
        a list of the alternatives by order of preference
      • listAlternativeToListSetAlternative

        public static List<Set<Alternative>> listAlternativeToListSetAlternative​(List<Alternative> list)
        Parameters:
        list - a list of alternatives not null
        Returns:
        a list of set of alternatives. each set is composed of one alternative
      • listSetAlternativeToList

        public static List<Alternative> listSetAlternativeToList​(List<Set<Alternative>> sets)
        Parameters:
        sets - not null
        Returns:
        a list of alternatives from a list of sets of alternatives.
      • createStrictCompletePreferenceImpl

        public static OldLinearPreferenceImpl createStrictCompletePreferenceImpl​(List<Alternative> preference)
        Factory method for StrictCompletePreferenceImpl
        Parameters:
        preference - not null and all different alternatives
        Returns:
        a new StrictCompletePreferenceImpl