/** Deassigns the node from a children, when it is removed from * a children. */ final void deassignFrom(Children parent) { synchronized (LOCK) { Children p = getParentChildren(); if (parent != p) { throw new IllegalArgumentException("Deassign from wrong parent. Old: " + p + " Caller: " + parent); //NOI18N } this.parent = null; } }
/** 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(); }
Children ch = getParentChildren();
/** Deassignes the node from a children, when it is removed from * a children. */ final synchronized void deassignFrom (Children parent) { Children p = getParentChildren (); if (parent != p) { throw new IllegalArgumentException ("Deassign from wrong parent. Old: " + p + " Caller: " + parent); //NOI18N } this.parent = null; }
/** Deassignes the node from a children, when it is removed from * a children. */ final synchronized void deassignFrom (Children parent) { Children p = getParentChildren (); if (parent != p) { throw new IllegalArgumentException ("Deassign from wrong parent. Old: " + p + " Caller: " + parent); //NOI18N } this.parent = null; }
/** 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 (); }
/** 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; } }