(PlayerCharacter pc, String name)
| 131 | } |
| 132 | |
| 133 | public static List<NoteItem> getNoteList(PlayerCharacter pc, String name) |
| 134 | { |
| 135 | List<NoteItem> noteList = new ArrayList<>(); |
| 136 | List<NoteItem> resultList; |
| 137 | |
| 138 | buildSubTree(noteList, pc.getDisplay().getNotesList(), -1); |
| 139 | |
| 140 | if ("ALL".equals(name)) |
| 141 | { |
| 142 | resultList = noteList; |
| 143 | } |
| 144 | else |
| 145 | { |
| 146 | resultList = new ArrayList<>(); |
| 147 | try |
| 148 | { |
| 149 | int i = Integer.parseInt(name); |
| 150 | |
| 151 | resultList.add(noteList.get(i)); |
| 152 | } |
| 153 | catch (NumberFormatException e) |
| 154 | { |
| 155 | resultList = new ArrayList<>(noteList); |
| 156 | |
| 157 | for (int i = resultList.size() - 1; i >= 0; --i) |
| 158 | { |
| 159 | final NoteItem ni = resultList.get(i); |
| 160 | |
| 161 | if (!ni.getName().equalsIgnoreCase(name)) |
| 162 | { |
| 163 | resultList.remove(i); |
| 164 | } |
| 165 | } |
| 166 | } |
| 167 | } |
| 168 | return resultList; |
| 169 | } |
| 170 | |
| 171 | /** |
| 172 | * Populate the target list with the children of the specified node. |
no test coverage detected