|
AddressSpace library v1.0 beta | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Page | +--SwappingPage
Field Summary | |
protected boolean |
dirty
The memory image differs from the file image. |
protected long |
position
The position of the page inside it's swap. |
protected java.io.RandomAccessFile |
swapper
The swap where the page resides. |
Fields inherited from class Page |
data,
filler,
interStep,
pageSize |
Constructor Summary | |
SwappingPage(java.io.RandomAccessFile raf)
Create a new page inside a swap. |
|
SwappingPage(java.io.RandomAccessFile raf,
long offset)
Create a new page inside a swap. |
|
SwappingPage(java.io.RandomAccessFile raf,
long offset,
boolean toBeRead)
Create a new page inside a swap. |
Method Summary | |
long |
getPosition()
Retrieve the position of the page inside the swap. |
void |
setDirty()
Set the page as dirty. |
void |
setPosition(int loc)
Relocate the page inside the swap. |
void |
sync()
Synchronize the memory image and the disk image. |
int |
write(int offset,
byte v)
Write a byte in the page. |
int |
write(int offset,
byte[] buffer)
Write an array of bytes to the page. |
int |
write(int offset,
byte[] buffer,
int len)
Write an array of bytes to the page. |
int |
write(int offset,
byte[] buffer,
int len,
int boffset)
Write an array of bytes to the page. |
int |
writeInt(int offset,
int value)
Write an integer to the page. |
int |
writeLong(int offset,
long value)
Write a long integer to the page. |
int |
writeShort(int offset,
short value)
Write a short int to the page. |
void |
zeroFill()
Blank a page. |
Methods inherited from class Page |
dump,
getData,
isAllZero,
read,
read,
read,
read,
readInt,
readLong,
readShort,
toString,
toString |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected long position
protected java.io.RandomAccessFile swapper
protected boolean dirty
Constructor Detail |
public SwappingPage(java.io.RandomAccessFile raf) throws java.io.IOException
raf
- the RandomAccessFile to be used as the swap.
connected to the page.public SwappingPage(java.io.RandomAccessFile raf, long offset, boolean toBeRead) throws java.io.IOException
raf
- the RandomAccessFile to be used as the swap.offset
- the location of the page inside the swap.toBeRead
- flag that is true if the page has to be
read from the swap, false if the content in the swap has to be
lost and replaced by the page one.public SwappingPage(java.io.RandomAccessFile raf, long offset) throws java.io.IOException
raf
- the RandomAccessFile to be used as the swap.offset
- the location of the page inside the swap.Method Detail |
public void zeroFill()
public long getPosition()
public void setPosition(int loc)
loc
- the new location of the page.public void setDirty()
public void sync() throws java.io.IOException
public int write(int offset, byte v)
offset
- the location of the byte to write.v
- the value to write.public int write(int offset, byte[] buffer)
offset
- the location of the bytes to write.buffer
- the buffer to be written.public int write(int offset, byte[] buffer, int len)
offset
- the location of the bytes to write.buffer
- the buffer to be written.len
- the number of bytes to write.public int write(int offset, byte[] buffer, int len, int boffset)
offset
- the location of the bytes to write.buffer
- the buffer to be written.len
- the number of bytes to write.boffset
- the offset inside the buffer.public int writeShort(int offset, short value) throws NotAlignedPointer
offset
- the location of the page where the data is located.public int writeInt(int offset, int value) throws NotAlignedPointer
offset
- the location of the page where the data is located.public int writeLong(int offset, long value) throws NotAlignedPointer
offset
- the location of the page where the data is located.
|
Help is irrilevant You will be assimilated! |
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |