List<SubtitleEntry> listaAuxiliar = new ArrayList<SubtitleEntry>();
Iterator<InfoShowOccupation> iterator = listaAulas.iterator();
while (iterator.hasNext()) {
InfoShowOccupation elem = iterator.next();
if (elem instanceof InfoLesson || elem instanceof InfoLessonInstance) {
SubtitleEntry subtitleEntry =
new SubtitleEntry(elem.getInfoShift().getInfoDisciplinaExecucao().getSigla(), elem.getInfoShift()
.getInfoDisciplinaExecucao().getNome());
if (!listaAuxiliar.contains(subtitleEntry)) {
listaAuxiliar.add(subtitleEntry);
}
}
}
if (listaAuxiliar.size() > 1) {
Collections.sort(listaAuxiliar);
result.append("<br/><b>");
result.append(getMessageResource(pageContext, "public.degree.information.label.legend"));
result.append("</b><br /><br /><table cellpadding='0' cellspacing='0' style='margin-left:5px'>");
for (int i = 0; i < listaAuxiliar.size(); i++) {
SubtitleEntry elem = listaAuxiliar.get(i);
boolean oddElement = (i % 2 == 1);
if (!oddElement) {
result.append("<tr>\r\n");
}
result.append("<td width='60'><b>");
result.append(elem.getKey());
result.append("</b></td><td style='vertical-align:top'>-</td><td>");
result.append(elem.getValue());
result.append("</td>");
if (oddElement) {
result.append("</tr>\r\n");
}