source: voting/src/main/java/geniusweb/voting/VotingEvaluatorWithValue.java@ 52

Last change on this file since 52 was 52, checked in by ruud, 14 months ago

Fixed small issues in domaineditor.

File size: 2.1 KB
Line 
1package geniusweb.voting;
2
3import com.fasterxml.jackson.annotation.JsonAutoDetect;
4import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
5import com.fasterxml.jackson.annotation.JsonSubTypes;
6import com.fasterxml.jackson.annotation.JsonTypeInfo;
7import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
8
9import geniusweb.inform.Agreements;
10import geniusweb.voting.evaluatorwithvalue.LargestAgreementWithValue;
11
12/**
13 * Evaluates the {@link CollectedVotes}, determining the agreements and if the
14 * negotiation should continue.
15 *
16 * Implementations should be immutable and not serialize internal variables (eg
17 * @JsonIgnore them).
18 */
19@JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE)
20@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = As.WRAPPER_OBJECT)
21@JsonSubTypes({ @JsonSubTypes.Type(value = LargestAgreementWithValue.class) })
22public interface VotingEvaluatorWithValue {
23 /**
24 * This function is the effective constructor. This mechanism serves several
25 * purposes:
26 * <ul>
27 * <li>It defines the constructor at interface level, so that we can ensure
28 * it's available and can call it given an instance,
29 * <li>We can use a (typically blank) instance of this to make more
30 * instances
31 * <li>You can cache intermediate results in the object for caching
32 * </ul>
33 *
34 * @param votes the Votes made by parties in the round to be evaluated.. All
35 * active parties in the negotiation must be available, even if
36 * they did not vote, to ensure that {@link #isFinished()} can
37 * work properly.
38 *
39 * @return new VotingEvaluation object containing the given votes.
40 */
41 VotingEvaluatorWithValue create(CollectedVotesWithValue votes);
42
43 /**
44 *
45 * @return the agreements that is contained in the current available votes.
46 * The exact procedure varies with the implementation.
47 */
48 Agreements getAgreements();
49
50 /**
51 *
52 * @return true iff the negotiation is finished after taking the agreement
53 * returned by {@link #getAgreements()}
54 */
55 boolean isFinished();
56}
Note: See TracBrowser for help on using the repository browser.