Main Page | Packages | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

FODBIndexHeader.java

00001 /*
00002  * OpenMobileIS - a free Java(TM) Framework for mobile applications Java(TM)
00003  * Copyright (C) 2004-2005 Philippe Delrieu
00004  * All rights reserved.
00005  * Contact: openmobileis@e-care.fr
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
00020  * USA
00021  *
00022  *  Author : Philippe Delrieu
00023  *  
00024  *  Modifications :
00025  *  2004 Creation P.Delrieu
00026  *  2004 Modified by Romain Beaugrand
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     // fields
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 }

Generated on Wed Dec 14 21:05:33 2005 for OpenMobileIS by  doxygen 1.4.4