org.sourceforge.beanindex.util
Class VirtualMemory

java.lang.Object
  extended byorg.sourceforge.beanindex.util.VirtualMemory

public class VirtualMemory
extends java.lang.Object

Author:
Sakthivel Muthusamy

Constructor Summary
VirtualMemory(java.lang.String path)
           
 
Method Summary
 int allocate()
           
 void delete()
           
 int getPageSize()
          Returns the size of the Virtual Memory page
 int read(int page, int offset)
           
 int[] readPage(int page)
          reads a page full of data
 void write(int page, int offset, int data)
           
 void writePage(int page, int[] data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VirtualMemory

public VirtualMemory(java.lang.String path)
              throws java.lang.Exception
Method Detail

allocate

public int allocate()
             throws java.lang.Exception
Returns:
int
Throws:
java.lang.Exception

write

public void write(int page,
                  int offset,
                  int data)
           throws java.lang.Exception
Parameters:
page -
offset -
data -
Throws:
java.lang.Exception

writePage

public void writePage(int page,
                      int[] data)
               throws java.lang.Exception
Parameters:
page -
data -
Throws:
java.lang.Exception

read

public int read(int page,
                int offset)
         throws java.lang.Exception
Parameters:
page -
offset -
Returns:
imt
Throws:
java.lang.Exception

readPage

public int[] readPage(int page)
               throws java.lang.Exception
reads a page full of data

Parameters:
page -
Returns:
int[]
Throws:
java.lang.Exception

delete

public void delete()
            throws java.lang.Exception
Throws:
java.lang.Exception

getPageSize

public int getPageSize()
Returns the size of the Virtual Memory page

Returns:
int