|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.jot.persistance.JOTFSIndex
public class JOTFSIndex
Represents an index for an FSDB database Used to find data faster and index/vacuum it. Note that the data file contains all it needs on it's own. The index can actually be rebuilt from the data file (ie: using JOTFSQueryImpl.vacuum())
| Field Summary | |
|---|---|
long |
highestId
Stores the current highest ID found in the data file, so we can get the next unique higher value using nextval() |
| Constructor Summary | |
|---|---|
JOTFSIndex()
|
|
| Method Summary | |
|---|---|
void |
addEntry(long id,
long offset)
hen a new entry is added to the data file(table), this should be called as well to update the index with it. |
void |
closeFile()
|
void |
deleteEntry(long id)
Call this after removing an entry from the data(table) This will remove it from the index as well. |
long |
getIndexValue(long index)
Returns the position od a data row given it's index |
long |
nextVal()
When adding a new entry, call this method to get the next unique index value. |
void |
setDataOffset(long id,
long offset)
Updates the offset of a data file row in the index |
void |
setFile(java.io.RandomAccessFile indexFile)
Sets the index file |
void |
setIndexIndexOffset(long id,
long indexPos)
Updates the IndexIndex |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public long highestId
| Constructor Detail |
|---|
public JOTFSIndex()
| Method Detail |
|---|
public long getIndexValue(long index)
index -
public void setDataOffset(long id,
long offset)
throws java.lang.Exception
index - value -
java.lang.Exceptionpublic long nextVal()
public void setFile(java.io.RandomAccessFile indexFile)
indexFile -
public void addEntry(long id,
long offset)
throws java.lang.Exception
indexFile - id - offset -
java.lang.Exceptionpublic void closeFile()
public void deleteEntry(long id)
throws java.lang.Exception
id -
java.lang.Exception
public void setIndexIndexOffset(long id,
long indexPos)
id - indexPos -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||