/** * Sets the child of this root. * @param child the child, can be <code>null</code> */ public void setChild( Entry child ){ if( child != null ){ if( child.asLeaf() == null && child.asNode() == null ){ throw new IllegalArgumentException( "child must either be a leaf or a node" ); } } if( this.child != null ){ this.child.setParent( null ); fireRemoved( this, this.child ); } this.child = child; if( this.child != null ){ this.child.setParent( this ); fireAdded( this, this.child ); } } }
/** * Sets the child of this root. * @param child the child, can be <code>null</code> */ public void setChild( Entry child ){ if( child != null ){ if( child.asLeaf() == null && child.asNode() == null ){ throw new IllegalArgumentException( "child must either be a leaf or a node" ); } } if( this.child != null ){ this.child.setParent( null ); fireRemoved( this, this.child ); } this.child = child; if( this.child != null ){ this.child.setParent( this ); fireAdded( this, this.child ); } } }
this.childA.setParent( null ); if( perspective != null ){ perspective.fireRemoved( this, this.childA );
this.childA.setParent( null ); if( perspective != null ){ perspective.fireRemoved( this, this.childA );
this.childB.setParent( null ); if( perspective != null ){ perspective.fireRemoved( this, this.childB );
this.childB.setParent( null ); if( perspective != null ){ perspective.fireRemoved( this, this.childB );