choco.kernel.common.opres.graph
Class ProperBinaryTree

java.lang.Object
  extended by choco.kernel.common.opres.graph.ProperBinaryTree
All Implemented Interfaces:
ITree
Direct Known Subclasses:
AbstractVilimTree

public class ProperBinaryTree
extends Object
implements ITree

Since:
5 févr. 2009 version 2.0.3
Version:
2.0.3
Author:
Arnaud Malapert

Constructor Summary
ProperBinaryTree()
           
 
Method Summary
 void fireTreeChanged()
           
protected  void fireTreeChanged(IBinaryNode node)
           
 int getDepth()
           
 int getNbInternalNodes()
           
 int getNbLeaves()
           
 IBinaryNode getRoot()
           
 IBinaryNode insert(INodeLabel leafStatus, INodeLabel internalStatus, boolean fireChanged)
           
protected  boolean isLeftOrRight(IBinaryNode node)
           
 void remove(IBinaryNode leaf, boolean fireChanged)
          remove a leaf from the tree.
 void removeLast(boolean fireChanged)
           
protected  void setRoot(IBinaryNode node)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProperBinaryTree

public ProperBinaryTree()
Method Detail

setRoot

protected void setRoot(IBinaryNode node)

getNbInternalNodes

public int getNbInternalNodes()
Specified by:
getNbInternalNodes in interface ITree

getNbLeaves

public final int getNbLeaves()
Specified by:
getNbLeaves in interface ITree

getDepth

public final int getDepth()
Specified by:
getDepth in interface ITree

insert

public IBinaryNode insert(INodeLabel leafStatus,
                          INodeLabel internalStatus,
                          boolean fireChanged)

isLeftOrRight

protected boolean isLeftOrRight(IBinaryNode node)

removeLast

public void removeLast(boolean fireChanged)

remove

public void remove(IBinaryNode leaf,
                   boolean fireChanged)
remove a leaf from the tree. throws UnsupportedOperationException if the argument is an internal node or is not in the tree.

Parameters:
leaf -
fireChanged -

fireTreeChanged

protected void fireTreeChanged(IBinaryNode node)

fireTreeChanged

public void fireTreeChanged()

getRoot

public final IBinaryNode getRoot()


Copyright © 2012. All Rights Reserved.