@Override protected void abstractFromText(String s) { int n = Integer.valueOf(s); if (0 < n && n <= radioButtonList.length) { radioButtonList[n].setSelected(true); } else { Util.runtimeException( String.format("n=%d radioButtonList.length=%d ", n, radioButtonList.length)); } }
@Override protected String abstractToText() { for (int i = 0; i < radioButtonList.length; i++) { if (radioButtonList[i].isSelected()) { return String.valueOf(i); } } Util.runtimeException("radioButtunに選択がない"); return ""; }