org.openmobileis.database.fastobjectdb.db.index
Class FODBIndex
java.lang.Object
|
+--org.openmobileis.database.fastobjectdb.db.index.FODBIndex
- Direct Known Subclasses:
- FODBIntIndex, FODBLongIndex, FODBStringIndex
- public abstract class FODBIndex
- extends java.lang.Object
FODBIndex is an abstract Class on which each type of index
will be based.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
UNIQUE
public static final int UNIQUE
MULTIPLE
public static final int MULTIPLE
name
protected java.lang.String name
accessObj
protected final java.lang.reflect.AccessibleObject accessObj
colFile
protected FODBCollectionIndexFile colFile
header
protected FODBIndexHeader header
minKey
protected int minKey
FODBIndex
public FODBIndex(FODBIndexHeader newHeader,
FODBCollectionIndexFile cFile,
java.lang.reflect.AccessibleObject accObj)
- Constructor of FODBIndex, using an index header.
Using an index header, means that we're opening (and not
creating) an index.
FODBIndex
public FODBIndex(FODBIndexDescriptor descriptor,
FODBCollectionIndexFile cFile,
java.lang.reflect.AccessibleObject accObj)
throws FODBException
- Constructor of FODBIndex, using an index descriptor.
Using an index descriptor, means that we're creating (and not
opening) an index.
This is the reason why this constructor is little bit more
complicated that the upper one.
readRoot
public Node readRoot()
throws java.io.IOException,
java.lang.ClassNotFoundException
getName
public java.lang.String getName()
getPos
public long getPos()
isEmpty
public boolean isEmpty()
throws FODBException
- return true if the index is empty.
throws StoreBTreeException if the index is closed
add
public void add(java.lang.Object obj,
long pos)
throws FODBException
- Add a new pointer in our index.
- Parameters:
obj
- - helps us getting the key.pos
- - position of the element in the collection file.- Throws:
FODBDataFileException
- FODBIndexException
- BTreeException
-
getAccessObjType
public java.lang.Class getAccessObjType()
delObjectWithKey
public boolean delObjectWithKey(java.lang.Object obj,
long pos)
throws FODBException
- Remove a pointer from our index.
- Parameters:
obj
- - helps us getting the key.pos
- - position of the element in the collection file.- Returns:
- true if the operation succeed, false otherwise.
- Throws:
FODBIndexException
-
getIndexHeader
public FODBIndexHeader getIndexHeader()
query
public abstract long[] query(SodaIndexComparator comparator)
throws FODBQueryException
specificDescriptorVerifications
protected abstract void specificDescriptorVerifications(FODBIndexDescriptor descriptor)
throws FODBException
initRoot
protected abstract Node initRoot(FODBIndexDescriptor descriptor)
throws FODBException
specificHeaderInit
protected abstract void specificHeaderInit(FODBIndexDescriptor descriptor)
throws FODBException
getType
public abstract int getType()
insertKey
protected abstract void insertKey(java.lang.Object key,
long pos)
throws java.io.IOException,
java.lang.ClassNotFoundException,
FODBException
deleteKey
protected abstract boolean deleteKey(java.lang.Object obj,
long pos)
throws java.io.IOException,
java.lang.ClassNotFoundException,
FODBException
getIndexDescriptor
public abstract FODBIndexDescriptor getIndexDescriptor()
getKey
public abstract java.lang.Object getKey(java.lang.Object obj)
throws FODBException
getArrayKey
public abstract Array getArrayKey(java.lang.Object obj)
throws FODBException
toString
public java.lang.String toString()
- Helps us debugging.
- Overrides:
toString
in class java.lang.Object
Copyright 2005 e-Care. All Rights Reserved.