Refactor: some more comments, and better looking code in VotingBoothImpl.java
parent
0956fa98d3
commit
88991ea9ff
|
@ -20,11 +20,16 @@ import java.util.Map;
|
|||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
/**
|
||||
* Created by hai on 28/03/16.
|
||||
* An asynchronous implementation of the VotingBoothController.
|
||||
* This implementation binds the other components (storage, ui, output device, and crypto manager),
|
||||
* and runs as its own thread controlling the whole VB process.
|
||||
* The high level details are that it has a queue of commands to handle in order, and a State object which keeps
|
||||
* all data from previous tasks which is necessary for the next task.
|
||||
* It calls executions in the UI and output device asynchronously.
|
||||
*/
|
||||
public class VotingBoothImpl implements VotingBoothController {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(VotingBoothImpl.class);;
|
||||
private final Logger logger = LoggerFactory.getLogger(VotingBoothImpl.class);
|
||||
|
||||
// the component interfaces of the Voting Booth
|
||||
private BallotOutputDevice outputDevice;
|
||||
|
@ -34,7 +39,6 @@ public class VotingBoothImpl implements VotingBoothController {
|
|||
|
||||
// election details and info
|
||||
private List<BallotQuestion> questionsForChoosingChannel;
|
||||
private List<BallotQuestion> questions;
|
||||
private QuestionSelector questionSelector;
|
||||
private Map<String, UIElement> systemMessages;
|
||||
|
||||
|
@ -82,8 +86,8 @@ public class VotingBoothImpl implements VotingBoothController {
|
|||
|
||||
logger.info("init: setting the election parameters");
|
||||
this.questionsForChoosingChannel = electionParams.getChannelChoiceQuestionsList();
|
||||
this.questions = electionParams.getRaceQuestionsList();
|
||||
this.questionSelector = new SimpleListCategoriesSelector(this.questions, electionParams.getSelectionData());
|
||||
List<BallotQuestion> questions = electionParams.getRaceQuestionsList();
|
||||
this.questionSelector = new SimpleListCategoriesSelector(questions, electionParams.getSelectionData());
|
||||
logger.info("init: setting finished");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue