choco.kernel.common.opres.graph
Class ProperBinaryTree
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ProperBinaryTree
public ProperBinaryTree()
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.