public Iterator < TreeNode > findChildren ( String name ) { List < TreeNode > results ; if ( children == null ) results = Collections . emptyList ( ) ; else { results = new ArrayList < TreeNode > ( ) ; for ( TreeNode item : children ) { if ( name . equals ( item . getName ( ) ) ) results . add ( item ) ; } } return results . iterator ( ) ; }
Return an Iterator over all children of this node that have the specified name . If there are no such children an empty Iterator is returned .