Opus5
Class BinomialQueue.BinomialTree

java.lang.Object
  |
  +--Opus5.AbstractObject
        |
        +--Opus5.AbstractContainer
              |
              +--Opus5.AbstractTree
                    |
                    +--Opus5.GeneralTree
                          |
                          +--Opus5.BinomialQueue.BinomialTree
All Implemented Interfaces:
Comparable, Container, Tree
Enclosing class:
BinomialQueue

protected static class BinomialQueue.BinomialTree
extends GeneralTree

A node in a binomial tree.

Version:
$Id: BinomialQueue.java,v 3.7 1998/07/29 14:24:26 brpreiss Exp $
Author:
Bruno R. Preiss, P.Eng.

Inner classes inherited from class Opus5.AbstractTree
AbstractTree.TreeEnumeration
 
Fields inherited from class Opus5.GeneralTree
degree, key, list
 
Fields inherited from class Opus5.AbstractContainer
count
 
Fields inherited from interface Opus5.Tree
copyright
 
Constructor Summary
BinomialQueue.BinomialTree(java.lang.Object key)
          Constructs a BinomialTree of order zero that contains the specified key.
 
Method Summary
protected  void add(BinomialQueue.BinomialTree tree)
          Adds the specified binomial tree to this binomial tree.
 int getCount()
          Returns the number of objects contained in this binomial tree.
 
Methods inherited from class Opus5.GeneralTree
attachSubtree, compareTo, detachSubtree, getDegree, getKey, getSubtree, isEmpty, isLeaf, purge
 
Methods inherited from class Opus5.AbstractTree
accept, breadthFirstTraversal, depthFirstTraversal, getEnumeration, getHeight
 
Methods inherited from class Opus5.AbstractContainer
hashCode, isFull, toString
 
Methods inherited from class Opus5.AbstractObject
compare, equals, isEQ, isGE, isGT, isLE, isLT, isNE
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface Opus5.Container
isFull
 
Methods inherited from interface Opus5.Comparable
compare, isEQ, isGE, isGT, isLE, isLT, isNE
 

Constructor Detail

BinomialQueue.BinomialTree

public BinomialQueue.BinomialTree(java.lang.Object key)
Constructs a BinomialTree of order zero that contains the specified key.
Parameters:
key - The specified key.
Method Detail

getCount

public int getCount()
Returns the number of objects contained in this binomial tree.
Overrides:
getCount in class AbstractTree
Returns:
The number of objects contained in this binomial tree.

add

protected void add(BinomialQueue.BinomialTree tree)
Adds the specified binomial tree to this binomial tree. The specified binomial tree and this binomial tree must have the same order.
Parameters:
tree - The binomial tree to add to this binomial tree.
Throws:
java.lang.IllegalArgumentException - If the orders of the trees differ.