|
AddressSpace library v1.0 beta | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mmap.LruQueue
This list keeps SwappingPages in a Last Recently Used order.
Inner Class Summary | |
protected class |
LruQueue.Entry
|
Field Summary | |
protected IntHashtable |
allPages
All the page in the queue in an hash fashion for fast retrieval. |
protected LruQueue.Entry |
cursor
Actual examined entry of the queue. |
protected int |
howMany
Number of pages in the queue. |
protected LruQueue.Entry |
last
Last entry of the queue. |
protected int |
pageLimit
Maximum number of page allowed before trashing the last one. |
protected LruQueue.Entry |
queue
First entry of the queue. |
protected AddressSpace |
trasher
AddressSpace object the page belongs to. |
Constructor Summary | |
LruQueue(int pages)
Create a new empty queue. |
|
LruQueue(int pages,
AddressSpace aSpace)
Create a new empty queue associated to an AddressSpace. |
Method Summary | |
void |
add(int id,
SwappingPage page)
Add a page in the Queue The page will be added as the mostly recent accessed (last entry). It's known that the page is not already in the list. If the page is already full the least recently used page is trashed from the queue. |
void |
clear()
Clear the queue synchronizing and purging all the pages. |
void |
dump(java.io.OutputStream s)
Dump the queue into a file in a string readable format. |
int |
getOccupiedSize()
Get the number of the page in the queue. |
int |
getSize()
Get the size of the queue in pages |
SwappingPage |
select(int id)
Get a page from the Queue The page will be also marked as the mostly recent accessed (last entry). |
void |
setSize(int size)
Set the number of the page in that fit in the queue. |
void |
sync()
Synchronize (update disk image) all the pages in the queue. |
java.lang.String |
toString()
Convert the queue in a string. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected LruQueue.Entry queue
protected LruQueue.Entry last
protected LruQueue.Entry cursor
protected IntHashtable allPages
protected int howMany
protected int pageLimit
protected AddressSpace trasher
Constructor Detail |
public LruQueue(int pages)
pages
- the number of pages in the queuepublic LruQueue(int pages, AddressSpace aSpace)
pages
- the number of pages in the queueaSpace
- the associated AddressSpaceMethod Detail |
public void add(int id, SwappingPage page) throws java.io.IOException
id
- an identificator that will be associated to the pagepage
- the page to addpublic SwappingPage select(int id)
id
- the identificator of the page to retrievepublic void sync() throws java.io.IOException
public void clear() throws java.io.IOException
public int getSize()
public int getOccupiedSize()
public void setSize(int size) throws java.io.IOException
size
- the number of SwappingPages for the new queue sizepublic java.lang.String toString()
public void dump(java.io.OutputStream s) throws java.io.IOException
|
Help is irrilevant You will be assimilated! |
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |