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

FODBIndexDescriptor.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;
00030 
00041 public abstract class FODBIndexDescriptor implements java.io.Serializable       {
00042         static final long serialVersionUID = 5521257935120563452L;
00043         public static final int UNIQUE = 1;
00044         public static final int MULTIPLE = 2;
00045         private String name;
00046         private String memberName;
00047         private int type;
00048         private int order;
00049         
00050         public FODBIndexDescriptor(String newName, int indexType, String newMemberName, int btreeorder) {
00051                 //correct Btree algo pb. Order must be pair
00052                 if (btreeorder%2 != 0)  {
00053                         btreeorder = btreeorder+1;
00054                 }
00055                 this.order = btreeorder;
00056                 name = newName;
00057                 this.type = indexType;
00058                 memberName = newMemberName;
00059         }
00060         
00061         public String getName() {
00062                 return name;
00063         }
00064         
00065         public String getMemberName() {
00066                 return memberName;
00067         }
00068         
00069         public int getType() {
00070                 return type;
00071         }
00072         
00073         public boolean isUnique() {
00074                 return (type == UNIQUE) ? true : false;
00075         }
00076         
00077         public boolean isMultiple() {
00078                 return (type == MULTIPLE) ? true : false;
00079         }
00080 
00081         public int getOrder() {
00082                 return order;
00083         }
00084 }

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