private void linkChild(final int x1,final int y1){
  if (!isValid(x1,y1)) {
    return;
  }
  TreeNode child=nodeRegistry.get(createNodeID(x1,y1));
  if (child == null) {
    child=createNode(x1,y1);
    addChild(child);
    openList.offer(child);
    child.setOpen(true);
    nodeRegistry.put(child.nodeNumber,child);
  }
 else {
    if (child.g > (this.g + child.getCost())) {
      updateChild(child);
    }
    if (!child.isOpen()) {
      updateSubTree(child);
    }
  }
}

private void linkChild ( final int x1 , final int y1 ) { if ( ! isValid ( x1 , y1 ) ) { return ; } TreeNode child = nodeRegistry . get ( createNodeID ( x1 , y1 ) ) ; if ( child == null ) { child = createNode ( x1 , y1 ) ; addChild ( child ) ; openList . offer ( child ) ; child . setOpen ( true ) ; nodeRegistry . put ( child . nodeNumber , child ) ; } else { if ( child . g > ( this . g + child . getCost ( ) ) ) { updateChild ( child ) ; } if ( ! child . isOpen ( ) ) { updateSubTree ( child ) ; } } }
links the children to this parent node and may also update the parent path , if a shorter path is found .
