public void refreshDetails(PollMaintActionForm form, PollHeader pollHeader) {
Iterator<?> iterator = pollHeader.getPollDetails().iterator();
int totalVoteCount = 0;
while (iterator.hasNext()) {
PollDetail pollDetail = (PollDetail) iterator.next();
totalVoteCount += pollDetail.getPollVoteCount().intValue();
}
Vector<PollDetailForm> vector = new Vector<PollDetailForm>();
iterator = pollHeader.getPollDetails().iterator();
while (iterator.hasNext()) {
PollDetail pollDetail = (PollDetail) iterator.next();
PollDetailForm pollDetailForm = new PollDetailForm();
pollDetailForm.setPollDetailId(Format.getLong(pollDetail.getPollDetailId()));
pollDetailForm.setPollOption(pollDetail.getPollOption());
pollDetailForm.setSeqNum(Format.getInt(pollDetail.getSeqNum()));
pollDetailForm.setPollVoteCount(Format.getInt(pollDetail.getPollVoteCount()));
if (totalVoteCount > 0) {
pollDetailForm.setPollPercentage(Format.getInt(pollDetail.getPollVoteCount() * 100 / totalVoteCount) + "%");
}
vector.add(pollDetailForm);
}
PollDetailForm pollDetails[] = new PollDetailForm[vector.size()];
vector.copyInto(pollDetails);