KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > h2 > index > LinearHashHead


1 /*
2  * Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
3  * Initial Developer: H2 Group
4  */

5 package org.h2.index;
6
7 import java.sql.SQLException JavaDoc;
8
9 import org.h2.store.DataPage;
10 import org.h2.store.Record;
11
12 public class LinearHashHead extends Record {
13
14     private LinearHashIndex index;
15     int baseSize;
16     int nextToSplit;
17     int recordCount, bucketCount;
18
19     LinearHashHead(LinearHashIndex index) {
20         this.index = index;
21     }
22     
23     LinearHashHead(LinearHashIndex index, DataPage s) {
24         this.index = index;
25         baseSize = s.readInt();
26         nextToSplit = s.readInt();
27         recordCount = s.readInt();
28         bucketCount = s.readInt();
29     }
30
31     public int getByteCount(DataPage dummy) throws SQLException JavaDoc {
32         return index.getBucketSize();
33     }
34
35     public void write(DataPage buff) throws SQLException JavaDoc {
36         buff.writeByte((byte)'H');
37         buff.writeInt(baseSize);
38         buff.writeInt(nextToSplit);
39         buff.writeInt(recordCount);
40         buff.writeInt(bucketCount);
41     }
42     
43     public boolean isPinned() {
44         return true;
45     }
46
47 }
48
Popular Tags