HufNode.cpp
上传用户:liruoru
上传日期:2007-07-02
资源大小:43k
文件大小:1k
- // HufNode.cpp: implementation of the HufNode class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "HUF3.h"
- #include "HufNode.h"
- #ifdef _DEBUG
- #undef THIS_FILE
- static char THIS_FILE[]=__FILE__;
- #define new DEBUG_NEW
- #endif
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- HufNode::HufNode()
- {
- }
- HufNode::~HufNode()
- {
- }
- HufNode::HufNode(char c, double p)
- {
- name=c;
- weight=p;
- }
- void HufNode::initnode()
- {
- parent=0;
- lchild=0;
- rchild=0;
- weight=0;
- name=NULL;
- code=NULL;
- }
- char HufNode::GetName()
- {
- return name;
- }
- double HufNode::GetWeight()
- {
- return weight;
- }
- void HufNode::PutParent(int p)
- {
- parent=p;
- }
- void HufNode::PutLchild(int p)
- {
- lchild=p;
- }
- void HufNode::PutRchild(int p)
- {
- rchild=p;
- }
- void HufNode::PutWeight(double d)
- {
- weight=d;
- }
- int HufNode::GetParent()
- {
- return parent;
- }
- void HufNode::PutName(char c)
- {
- name=c;
- }