public JudgingSection updateSectionOnline(Integer section) { JudgingSection found = null; for (JudgingSection js : judgingSections) { if (js.getSectionNbr().compareTo(section) == 0) { js.setClientDeviceAttached(true); found = js; break; } } return found; }
public String getSectionsConnectedNamesAsString() { StringBuffer sb = new StringBuffer(); boolean first = true; for (JudgingSection s : judgingSections) { if (s.getClientDeviceAttached()) { if (!first) { sb.append(","); } first = false; sb.append(s.getSectionNbr()); } } if (sb.length() == 0) { sb.append(SECTIONS_NONE); } return sb.toString(); }