Interface ImmutablePreference
-
- All Superinterfaces:
Preference
- All Known Subinterfaces:
ImmutableAntiSymmetricPreference
,ImmutableCompletePreference
,ImmutableLinearPreference
- All Known Implementing Classes:
ImmutableAntiSymmetricPreferenceImpl
,ImmutableCompletePreferenceImpl
,ImmutableLinearPreferenceImpl
,ImmutablePreferenceImpl
public interface ImmutablePreference extends Preference
An Immutable Preference is a preference that cannot be modified ImmutablePreference can’t represent the case where we know that a ≥ b and ignore whether b ≥ a. This class is useful when "what we know so far" can be represented using ≥ only; in contrast to needing both ≥ and > (as in: I know that a > b and know that b ≥ c but ignore whether b > c). To put it otherwise, what I ignore must be symmetric. Two immutable preferences are equal iff their graphs are equal.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ImmutableGraph<Alternative>
asGraph()
In the graph : a relation from a to b means "a is at least as good as b".ImmutableSet<Alternative>
getAlternatives()
The returned set reads through this object: if this object is mutable, any modification to this object modifies the returned set, and conversely.-
Methods inherited from interface io.github.oliviercailloux.j_voting.preferences.Preference
getVoter
-
-
-
-
Method Detail
-
asGraph
ImmutableGraph<Alternative> asGraph()
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 immutable.- Specified by:
asGraph
in interfacePreference
- Returns:
- the Graph corresponding to the Preference.
-
getAlternatives
ImmutableSet<Alternative> getAlternatives()
The returned set reads through this object: if this object is mutable, any modification to this object modifies the returned set, and conversely. This set is immutable.- Specified by:
getAlternatives
in interfacePreference
- Returns:
- alternatives's set
-
-