Last change
on this file was 127, checked in by Wouter Pasman, 6 years ago |
#41 ROLL BACK of rev.126 . So this version is equal to rev. 125
|
File size:
1.1 KB
|
Line | |
---|
1 | package genius.core.actions;
|
---|
2 |
|
---|
3 | import javax.xml.bind.annotation.XmlElement;
|
---|
4 | import javax.xml.bind.annotation.XmlRootElement;
|
---|
5 |
|
---|
6 | import genius.core.AgentID;
|
---|
7 | import genius.core.Bid;
|
---|
8 | import genius.core.Vote;
|
---|
9 | import genius.core.parties.Mediator;
|
---|
10 | import genius.core.protocol.SimpleMediatorBasedProtocol;
|
---|
11 |
|
---|
12 | /**
|
---|
13 | * informs about a voting result. This action is created by {@link Mediator}s to
|
---|
14 | * inform the others about the current state. Also used by the
|
---|
15 | * {@link SimpleMediatorBasedProtocol} to find the last agreement. Immutable.
|
---|
16 | *
|
---|
17 | * @author Reyhan
|
---|
18 | */
|
---|
19 |
|
---|
20 | @XmlRootElement
|
---|
21 | public class InformVotingResult extends DefaultActionWithBid {
|
---|
22 | @XmlElement
|
---|
23 | protected Vote vote;
|
---|
24 |
|
---|
25 | public InformVotingResult(AgentID party, Bid bid, Vote vote) {
|
---|
26 | super(party, bid);
|
---|
27 | if (vote == null) {
|
---|
28 | throw new NullPointerException("vote=null");
|
---|
29 | }
|
---|
30 | this.vote = vote;
|
---|
31 | }
|
---|
32 |
|
---|
33 | /**
|
---|
34 | *
|
---|
35 | * @return a non-null vote
|
---|
36 | */
|
---|
37 | public Vote getVotingResult() {
|
---|
38 | return vote;
|
---|
39 | }
|
---|
40 |
|
---|
41 | public String toString() {
|
---|
42 | return "Voting Result: " + (vote == null ? "null" : (vote == Vote.ACCEPT ? "Accept" : "Reject"));
|
---|
43 | }
|
---|
44 |
|
---|
45 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.