📄 ballotpapers.java
字号:
public class BallotPapers
{
private Ballot[] ballots;
private int number;
private int round = 0;
private int MAXNUM = 100;
public BallotPapers()
{
number = 0;
ballots = new Ballot[MAXNUM];
}
public int getNumberOfBallot()
{
return number;
}
public void add(Ballot aBallot)
{
ballots[number] = aBallot;
number ++;
}
public Ballot getBallot(int index)
{
return ballots[index];
}
/*
public BallotPapers(String id)
{
number = 0;
ballots = new Ballon[MAXNUM];
BuildPapers(br);
}
*/
/*
public void BuildPapers(BufferedReader br) throws IOException
{
boolean endOfFile = false;
while (!endOfFile)
{
String line = br.readLine();
if (line == null)
endOfFile = true;
else
{
StringTokenizer st = new StringTokenizer(line);
String id;
Ballot ballot = new Ballot();
do
{
try
{
id = st.nextToken();
ballot.addCandidate(id);
}
catch(NoSuchElementException e)
{
break;
}
}
ballots.add(ballot);
}
}
*/
/*
public void firstVote()
{
int firstVoteNumber;
Candidate candidate = new Candidate();
String candidateId;
int i = 0;
round = 1;
for(i = 0 ; i< number ; i++)
{
candidate = ballots[i].getCandidate(round);
candidate .addVotesNumber();
}
}
public void otherVotes(int round)
{
int otherVotesNumber = 0;
boolean IsAdd = false;
String candidateId ;
int i;
for(i = 0 ; i< number ; i++ )
{
Candidate candidate = new Candidate();
candidate = ballots[i].getCandidate(round - 1);
if (candidate.isEliminated())
candidate.addOtherVotesNumber();
}
}
*/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -