jp.gr.java_conf.dangan.util.lha

Class HashShort

Implemented Interfaces:
HashMethod

public class HashShort
extends Object
implements HashMethod

データパタンの先頭2バイトから 0 〜 4095 のハッシュ値を生成するハッシュ関数。
 -- revision history --
 $Log: HashShort.java,v $
 Revision 1.0  2002/08/05 00:00:00  dangan
 add to version control
 [change]
     HashMethod のインタフェイス変更にあわせてインテフェイス変更。
 [maintanance]
     ソース整備
     タブ廃止
     ライセンス文の修正

 
Version:
$Revision: 1.0 $
Author:
$Author: dangan $

Constructor Summary

HashShort(byte[] TextBuffer)
データパタンの先頭2バイトから 0x000 〜 0xFFF までの値を生成する ハッシュ関数を構築する。

Method Summary

int
hash(int position)
ハッシュ関数。 コンストラクタで渡された TextBuffer の position からの データパタンの hash値を生成する。
int
hashRequires()
ハッシュ関数がハッシュ値を生成するために使用するバイト数を得る。
このハッシュ関数はデータパタンの先頭 2 バイトのデータから ハッシュ値を生成するため、このメソッドは常に 2 を返す。
int
tableSize()
ハッシュテーブルのサイズを得る。
このハッシュ関数は 0x000 〜 0xFFF までのハッシュ値を生成するため このメソッドは常に 0x1000(4096) を返す。

Constructor Details

HashShort

public HashShort(byte[] TextBuffer)
データパタンの先頭2バイトから 0x000 〜 0xFFF までの値を生成する ハッシュ関数を構築する。
Parameters:
TextBuffer - LZSS圧縮用のバッファ。 Hash値生成のため読み込み用に使用する。

Method Details

hash

public int hash(int position)
ハッシュ関数。 コンストラクタで渡された TextBuffer の position からの データパタンの hash値を生成する。
Specified by:
hash in interface HashMethod
Parameters:
position - データパタンの開始位置
Returns:
ハッシュ値

hashRequires

public int hashRequires()
ハッシュ関数がハッシュ値を生成するために使用するバイト数を得る。
このハッシュ関数はデータパタンの先頭 2 バイトのデータから ハッシュ値を生成するため、このメソッドは常に 2 を返す。
Specified by:
hashRequires in interface HashMethod
Returns:
常に 2

tableSize

public int tableSize()
ハッシュテーブルのサイズを得る。
このハッシュ関数は 0x000 〜 0xFFF までのハッシュ値を生成するため このメソッドは常に 0x1000(4096) を返す。
Specified by:
tableSize in interface HashMethod
Returns:
常に 0x1000(4096)

When you found typographical errors or omissions, Please mail to cqw10305@nifty.com
The company name and product name which are used in this document, it is the trademark or registered trademark of each company generally.
Copyright © 2001-2002 Michel Ishizuka. All Rights Reserved.