Class ImmutableLinearPreferenceImpl
- java.lang.Object
-
- io.github.oliviercailloux.j_voting.preferences.classes.ImmutableCompletePreferenceImpl
-
- io.github.oliviercailloux.j_voting.preferences.classes.ImmutableLinearPreferenceImpl
-
- All Implemented Interfaces:
ImmutableCompletePreference
,ImmutableLinearPreference
,ImmutablePreference
,Preference
public class ImmutableLinearPreferenceImpl extends ImmutableCompletePreferenceImpl implements ImmutableLinearPreference
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableLinearPreference
asLinearPreference(Voter voter, List<Alternative> listAlternatives)
ImmutableList<Alternative>
asList()
Best alternatives coming first in the list.boolean
equals(Object o2)
int
hashCode()
-
Methods inherited from class io.github.oliviercailloux.j_voting.preferences.classes.ImmutableCompletePreferenceImpl
asCompletePreference, asEquivalenceClasses, asGraph, getAlternatives, getAlternatives, getRank, getVoter, isStrict, toStrictPreference
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.github.oliviercailloux.j_voting.preferences.ImmutableCompletePreference
asEquivalenceClasses, getAlternatives, getRank
-
Methods inherited from interface io.github.oliviercailloux.j_voting.preferences.ImmutablePreference
asGraph, getAlternatives
-
Methods inherited from interface io.github.oliviercailloux.j_voting.preferences.Preference
getVoter
-
-
-
-
Method Detail
-
asLinearPreference
public static ImmutableLinearPreference asLinearPreference(Voter voter, List<Alternative> listAlternatives) throws EmptySetException, DuplicateValueException
- Parameters:
voter
-not null
listAlternatives
-not null
- Returns:
- new LinearPreference
- Throws:
EmptySetException
DuplicateValueException
-
asList
public ImmutableList<Alternative> asList()
Description copied from interface:ImmutableLinearPreference
Best alternatives coming first in the list.- Specified by:
asList
in interfaceImmutableLinearPreference
- Returns:
- a sorted list of alternatives corresponding to the preference.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classImmutableCompletePreferenceImpl
-
equals
public boolean equals(Object o2)
- Overrides:
equals
in classImmutableCompletePreferenceImpl
-
-