MCPcopy Create free account
hub / github.com/PCGen/pcgen / buildSubTree

Method buildSubTree

code/src/java/plugin/exporttokens/NoteToken.java:182–192  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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}

Callers 1

getNoteListMethod · 0.95

Calls 3

getParentIdMethod · 0.80
addMethod · 0.65
getIdMethod · 0.65

Tested by

no test coverage detected