存储类的实现

来源:互联网 发布:js bind函数 编辑:程序博客网 时间:2024/06/10 02:01

1.软件包
edu.ustc.gdfeng.lang
edu.ustc.gdfeng.search.webobject
2.包中的类
edu.ustc.gdfeng.lang 类包括 
BitConverter
edu.ustc.gdfeng.search.webobject 类包括
FormatHeadUtility
StoragePackage
WebObject
WebObjectHead
WebObjectIterator
WebObjectPackage
WebObjectPackageDescription
WebObjectPackageDescriptionHead
WebObjectPackageHead
WebObjectRecord
WebObjectRecordIterator
3.各个类的功能
(1)public class BitConverter

BitConverter has two functions: getBytes: to convert dataformats(including boolean, byte, short, char, int, long, float and double) tobytes; to[Format]: to convert bytes[index] to format(boolean, byte, short,char, int, long, float, double and String);

2)public class FormatHeadUtility

Check whether FormatVersion is Supported and whether twotokens are the same

3)public class StoragePackage

Create, open, append and close WebObjectPackage &WebObjectPackageDescription

4)public class WebObject

WebObject format: 1-30 WebObjectHead MimeType URL Content

5)public class WebObjectHead

WebObject head format: 1-5 Format Flag(WEBO) 6 Version7-8 Length of Mime Type 9-10 Length of URL 11-14 Length of Content 15-22Download Time 23-30 Expected Dead Time

6)public class WebObjectIteratorimplements java.util.Iterator<WebObject>

WebObject's Iterator

7)public class WebObjectPackage

WebObjectPackage format: 1-8 WebObjectPackageHeadWebObject 1 WebObject 2 ...

8)public class WebObjectPackageDescription

WebObjectPackageDescription format: 1-28WebObjectPackageDescriptionHead WebObjectRecord 1 WebObjectRecord 2 ...

9)public class WebObjectPackageDescriptionHead

WebObjectPackageDescription headformat: 1-5 Format Flag(WOPD) 6 Version 7-8 Base 9-10 Exponent 11-18 CreateTime19-26 DeadTime 27-28 Token(0x0D 0A)

10)public class WebObjectPackageHead

WebObjectPackage head format: 1-5Format Flag(WOP) 6 Version 7-8 Token(0x0D 0A)

11)public class WebObjectRecord

WebObjectRecord format:[url]/r/n[offset],[size]/r/n

12)public class WebObjectRecordIterator implements java.util.Iterator<WebObjectRecord>

WebObjectRecord's Iterator