Populate the target list with the children of the specified node. This will recursively build up a list of the nodes in the base list in breadth-first order. The initial call should have a parentNode of -1. This will add all children of the hard-coded base nodes. @param targetList The list to
(List<NoteItem> targetList, Collection<NoteItem> baseList, int parentNode)
| 180 | * @param parentNode The id of the node to be processed. |
| 181 | */ |
| 182 | private static void buildSubTree(List<NoteItem> targetList, Collection<NoteItem> baseList, int parentNode) |
| 183 | { |
| 184 | for (NoteItem note : baseList) |
| 185 | { |
| 186 | if (note.getParentId() == parentNode || (parentNode == -1 && note.getParentId() < 0)) |
| 187 | { |
| 188 | targetList.add(note); |
| 189 | buildSubTree(targetList, baseList, note.getId()); |
| 190 | } |
| 191 | } |
| 192 | } |
| 193 | } |
no test coverage detected