/** Get the parent node. * @return the parent node, or <CODE>null</CODE> if this node is the root of a hierarchy */ public final Node getParentNode() { // if contained in a list return its parent node Children ch = getParentChildren(); return (ch == null) ? null : ch.getNode(); }
/** Method that allows Children to change the parent children of * the node when the node is add to a children. * * @param parent the children that wants to contain this node * @param index index that will be assigned to this node * @exception IllegalStateException if this node already belongs to a children */ final synchronized void assignTo (Children parent, int index) { Children ch = getParentChildren (); if (ch != null && ch != parent) { throw new IllegalStateException ("Cannot initialize " + index + "th child of node " + parent.getNode () + "; it already belongs to node " + ch.getNode ()); // NOI18N } if ( ! ( this.parent instanceof ChildrenArray ) ) { this.parent = parent; } }
/** Method that allows Children to change the parent children of * the node when the node is add to a children. * * @param parent the children that wants to contain this node * @param index index that will be assigned to this node * @exception IllegalStateException if this node already belongs to a children */ final synchronized void assignTo (Children parent, int index) { Children ch = getParentChildren (); if (ch != null && ch != parent) { throw new IllegalStateException ("Cannot initialize " + index + "th child of node " + parent.getNode () + "; it already belongs to node " + ch.getNode ()); // NOI18N } if ( ! ( this.parent instanceof ChildrenArray ) ) { this.parent = parent; } }
/** Get the parent node. * @return the parent node, or <CODE>null</CODE> if this node is the root of a hierarchy */ public final Node getParentNode () { // if contained in a list return its parent node Children ch = getParentChildren (); return ch == null ? null : ch.getNode (); }
/** Get the parent node. * @return the parent node, or <CODE>null</CODE> if this node is the root of a hierarchy */ public final Node getParentNode () { // if contained in a list return its parent node Children ch = getParentChildren (); return ch == null ? null : ch.getNode (); }