reduced more compilation warnings by having better Generics type handling and better JavaDocs
parent
d8b766725b
commit
2336d44ffc
|
@ -133,7 +133,7 @@ public class SimpleListCategoriesSelector implements QuestionSelector {
|
||||||
/**
|
/**
|
||||||
* Verifies that the ballot answer is of length 1. (We do not yet handle multi-choice questions in the channel choice round).
|
* Verifies that the ballot answer is of length 1. (We do not yet handle multi-choice questions in the channel choice round).
|
||||||
* Otherwise, throws an exception.
|
* Otherwise, throws an exception.
|
||||||
* @param ballotAnswer
|
* @param ballotAnswer the answer to verify whose length is one
|
||||||
* @param questionNumber the number of the question (needed only for error message strings)
|
* @param questionNumber the number of the question (needed only for error message strings)
|
||||||
*/
|
*/
|
||||||
private void assertAnswerLengthIsOne (BallotAnswer ballotAnswer, int questionNumber) {
|
private void assertAnswerLengthIsOne (BallotAnswer ballotAnswer, int questionNumber) {
|
||||||
|
|
|
@ -124,7 +124,7 @@ public class SystemConsoleUI implements VotingBoothUI, Runnable {
|
||||||
@Override
|
@Override
|
||||||
public void startNewVoterSession(FutureCallback<Void> callback) {
|
public void startNewVoterSession(FutureCallback<Void> callback) {
|
||||||
logger.debug("UI interface call to startNewVoterSession");
|
logger.debug("UI interface call to startNewVoterSession");
|
||||||
queue.add(new StartSessionUICommand((ControllerCallback)callback));
|
queue.add(new StartSessionUICommand((NewVoterCallback)callback));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -135,8 +135,7 @@ public class SystemConsoleUI implements VotingBoothUI, Runnable {
|
||||||
logger.debug("UI entered doShowWelcomeScreen");
|
logger.debug("UI entered doShowWelcomeScreen");
|
||||||
System.out.println("Welcome, new voter!");
|
System.out.println("Welcome, new voter!");
|
||||||
waitForEnter(null);
|
waitForEnter(null);
|
||||||
ControllerCallback callback = command.getCallback();
|
ControllerCallback<Void> callback = command.getCallback();
|
||||||
assert (callback instanceof NewVoterCallback);
|
|
||||||
callback.onSuccess(null);
|
callback.onSuccess(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,7 +178,7 @@ public class SystemConsoleUI implements VotingBoothUI, Runnable {
|
||||||
@Override
|
@Override
|
||||||
public void chooseChannel(List<BallotQuestion> questions, FutureCallback<List<BallotAnswer>> callback) {
|
public void chooseChannel(List<BallotQuestion> questions, FutureCallback<List<BallotAnswer>> callback) {
|
||||||
logger.debug("UI interface call to chooseChannel");
|
logger.debug("UI interface call to chooseChannel");
|
||||||
ChannelChoiceUICommand command = new ChannelChoiceUICommand(questions, (ControllerCallback)callback);
|
ChannelChoiceUICommand command = new ChannelChoiceUICommand(questions, (ChannelChoiceCallback)callback);
|
||||||
queue.add(command);
|
queue.add(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,7 +212,7 @@ public class SystemConsoleUI implements VotingBoothUI, Runnable {
|
||||||
@Override
|
@Override
|
||||||
public void askVoterQuestions(List<BallotQuestion> questions, FutureCallback<List<BallotAnswer>> callback) {
|
public void askVoterQuestions(List<BallotQuestion> questions, FutureCallback<List<BallotAnswer>> callback) {
|
||||||
logger.debug("UI interface call to chooseChannel");
|
logger.debug("UI interface call to chooseChannel");
|
||||||
queue.add(new RaceVotingUICommand(questions, (ControllerCallback)callback));
|
queue.add(new RaceVotingUICommand(questions, (VotingCallback)callback));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -245,7 +244,7 @@ public class SystemConsoleUI implements VotingBoothUI, Runnable {
|
||||||
@Override
|
@Override
|
||||||
public void castOrAudit(FutureCallback<FinalizeBallotChoice> callback) {
|
public void castOrAudit(FutureCallback<FinalizeBallotChoice> callback) {
|
||||||
logger.debug("UI interface call to castOrAudit");
|
logger.debug("UI interface call to castOrAudit");
|
||||||
queue.add(new CastOrAuditUICommand((ControllerCallback)callback));
|
queue.add(new CastOrAuditUICommand((CastOrAuditCallback)callback));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -289,7 +288,7 @@ public class SystemConsoleUI implements VotingBoothUI, Runnable {
|
||||||
@Override
|
@Override
|
||||||
public void notifyVoterToWaitForFinish(UIElement message, FutureCallback<Void> callback) {
|
public void notifyVoterToWaitForFinish(UIElement message, FutureCallback<Void> callback) {
|
||||||
logger.debug("UI interface call to notifyVoterToWaitForFinish");
|
logger.debug("UI interface call to notifyVoterToWaitForFinish");
|
||||||
queue.add(new WaitForFinishUICommand(message, (ControllerCallback)callback));
|
queue.add(new WaitForFinishUICommand(message, (WaitForFinishCallback)callback));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -333,7 +332,7 @@ public class SystemConsoleUI implements VotingBoothUI, Runnable {
|
||||||
public void showErrorMessageWithButtons(UIElement errorMessage, UIElement[] buttonLabels, FutureCallback<Integer> callback) {
|
public void showErrorMessageWithButtons(UIElement errorMessage, UIElement[] buttonLabels, FutureCallback<Integer> callback) {
|
||||||
logger.debug("UI interface call to showErrorMessageWithButtons");
|
logger.debug("UI interface call to showErrorMessageWithButtons");
|
||||||
queue.clear();
|
queue.clear();
|
||||||
queue.add(new FatalErrorUICommand(errorMessage, buttonLabels, (ControllerCallback)callback));
|
queue.add(new FatalErrorUICommand(errorMessage, buttonLabels, (ControllerCallback<Integer>)callback));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue