00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 package org.openmobileis.database.fastobjectdb.db.index;
00030
00031 import java.io.*;
00032
00040 public class FODBIndexHeader implements Externalizable
00041 {
00042 static final long serialVersionUID = 3138616672520914061L;
00043
00044
00045
00046
00047 private String name;
00048 private String memberName;
00049 public int type;
00050 public int order;
00051 public int keyLen;
00052 public int incTabSize;
00053 public long pos;
00054 public long rootPtr;
00055
00056 public FODBIndexHeader() {
00057 }
00058
00059 public FODBIndexHeader(String iName, String mName) {
00060 name = iName;
00061 memberName = mName;
00062 }
00063
00064 public String getName() {
00065 return name;
00066 }
00067
00068 public String getMemberName() {
00069 return memberName;
00070 }
00071
00072 public void writeExternal(ObjectOutput out) throws IOException {
00073 int i;
00074
00075 for (i = 0; i < name.length(); i++) {
00076 out.writeChar(name.charAt(i));
00077 }
00078 out.writeChar('\0');
00079
00080 for (i = 0; i < memberName.length(); i++) {
00081 out.writeChar(memberName.charAt(i));
00082 }
00083 out.writeChar('\0');
00084
00085 out.writeInt(type);
00086 out.writeInt(order);
00087 out.writeInt(keyLen);
00088 out.writeInt(incTabSize);
00089 out.writeLong(pos);
00090 out.writeLong(rootPtr);
00091 }
00092
00093 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
00094 char parseChar;
00095
00096 StringBuffer tmpName = new StringBuffer();
00097 while ((parseChar = in.readChar()) != '\0') {
00098 tmpName.append(parseChar);
00099 }
00100 name = tmpName.toString();
00101
00102 StringBuffer tmpMemberName = new StringBuffer();
00103 while ((parseChar = in.readChar()) != '\0') {
00104 tmpMemberName.append(parseChar);
00105 }
00106 memberName = tmpMemberName.toString();
00107
00108 type = in.readInt();
00109 order = in.readInt();
00110 keyLen = in.readInt();
00111 incTabSize = in.readInt();
00112 pos = in.readLong();
00113 rootPtr = in.readLong();
00114 }
00115 }