|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.mhhe.clrs2e.Huffman.Node | +--com.mhhe.clrs2e.Huffman.InternalNode
Inner class for an internal node in a Huffman tree.
Nested Class Summary |
Nested classes inherited from class com.mhhe.clrs2e.DynamicSetElement |
DynamicSetElement.Helper |
Field Summary | |
private Huffman.Node |
left
This node's left child. |
private Huffman.Node |
right
This node's right child. |
Constructor Summary | |
Huffman.InternalNode(Huffman.Node left,
Huffman.Node right)
Creates a new internal node. |
Method Summary | |
int |
compareTo(java.lang.Object o)
Compares this node to another, based on their frequencies. |
java.lang.Comparable |
getKey()
Returns the frequency as the key. |
void |
setKey(java.lang.Comparable key)
Cannot set the key. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.mhhe.clrs2e.DynamicSetElement |
compareTo, getKey, setKey |
Field Detail |
private final Huffman.Node left
private final Huffman.Node right
Constructor Detail |
public Huffman.InternalNode(Huffman.Node left, Huffman.Node right)
left
- This node's left child.right
- This node's right child.Method Detail |
public void setKey(java.lang.Comparable key)
setKey
in interface DynamicSetElement
key
- The key, but it cannot be set.
java.lang.UnsupportedOperationException
- always.public java.lang.Comparable getKey()
getKey
in interface DynamicSetElement
public int compareTo(java.lang.Object o)
compareTo
in interface DynamicSetElement
o
- The other node.
java.lang.ClassCastException
- if o
does not
reference a Node
object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |