Package jp.gr.java_conf.dangan.util.lha
Class DynamicHuffman
- java.lang.Object
-
- jp.gr.java_conf.dangan.util.lha.DynamicHuffman
-
- All Implemented Interfaces:
java.lang.Cloneable
public class DynamicHuffman extends java.lang.Object implements java.lang.Cloneable
???I?n?t?}?????????N???X?B-- revision history -- $Log: DynamicHuffman.java,v $ Revision 1.0 2002/07/24 00:00:00 dangan add to version control [bug fix] addLeaf() ???t?????? 1 ???? 2?????????????????? ???????????????t???d???? 1 ?????????t????????B [change] ?R???X?g???N?^ DynamicHuffman( int, int ) ?? ?J?n?????n?t?}???????T?C?Y?????? ?J?n?????t???????n???????????X?B [maintenance] ?\?[?X???? ?^?u?p?~ ???C?Z???X??????X
- Version:
- $Revision: 1.0 $
- Author:
- $Author: dangan $
-
-
Field Summary
Fields Modifier and Type Field Description static int
ROOT
?n?t?}?????????[?g???????B
-
Constructor Summary
Constructors Constructor Description DynamicHuffman(int count)
?R???X?g???N?^DynamicHuffman(int max, int first)
?R???X?g???N?^
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLeaf(int code)
?n?t?}?????? code ???????t???????????Bint
childNode(int node)
?m?[?h???t??????m?[?h?????q?m?[?h???m?[?h?????A ?m?[?h???t?????m?[?h???????f?[?^???S?r?b?g???]???????????????B ?q?m?[?h???m?[?h???????Z???????????p?????????A
node ?? 0 ???q?m?[?h?????? childNode( node )
node ?? 1 ???q?m?[?h?????? childNode( node ) - 1
???????Bjava.lang.Object
clone()
?}???I?u?W?F?N?g???????????????????R?s?[??????????????Bint
codeToNode(int code)
?f?[?^?????m?[?h???????????Bint
parentNode(int node)
node ???e?m?[?h???m?[?h???????????Bvoid
update(int code)
code ???d???????????????n?t?}???????X?V?????B
-
-
-
Field Detail
-
ROOT
public static final int ROOT
?n?t?}?????????[?g???????B- See Also:
- Constant Field Values
-
-
Method Detail
-
clone
public java.lang.Object clone()
?}???I?u?W?F?N?g???????????????????R?s?[??????????????B- Overrides:
clone
in classjava.lang.Object
- Returns:
- ?}???I?u?W?F?N?g???????????????????R?s?[
-
codeToNode
public int codeToNode(int code)
?f?[?^?????m?[?h???????????B- Parameters:
code
- ?f?[?^- Returns:
- code???m?[?h????
-
childNode
public int childNode(int node)
?m?[?h???t??????m?[?h?????q?m?[?h???m?[?h?????A ?m?[?h???t?????m?[?h???????f?[?^???S?r?b?g???]???????????????B ?q?m?[?h???m?[?h???????Z???????????p?????????A
node ?? 0 ???q?m?[?h?????? childNode( node )
node ?? 1 ???q?m?[?h?????? childNode( node ) - 1
???????B- Parameters:
node
- ?m?[?h- Returns:
- node ???q?m?[?h???m?[?h????
-
parentNode
public int parentNode(int node)
node ???e?m?[?h???m?[?h???????????B- Parameters:
node
- ?m?[?h- Returns:
- node ???e?m?[?h???m?[?h?????B
-
update
public void update(int code)
code ???d???????????????n?t?}???????X?V?????B- Parameters:
code
- ?d???????????t
-
addLeaf
public void addLeaf(int code)
?n?t?}?????? code ???????t???????????B- Parameters:
code
- ?t??????????- Throws:
java.lang.IllegalStateException
- ?n?t?}???????\????????????? ?t?????????????????
-
-