cse378.pagetable
Class PageTableEntry
java.lang.Object
cse378.AbstractBlock
cse378.TaggedBlock
cse378.pagetable.PageTableEntry
public class PageTableEntry
- extends TaggedBlock
Represents the mapping between a virtual page and a physical page
Field Summary |
(package private) static int |
count
|
protected cse378.address.PhysicalPage |
page
|
protected boolean |
swapped
|
Constructor Summary |
PageTableEntry(cse378.address.VirtualPage v,
cse378.address.PhysicalPage p)
|
Method Summary |
cse378.address.PhysicalPage |
getPhysical()
Get the physical page represented by this mapping |
cse378.address.VirtualPage |
getTag()
Get the virtual page represented by this mapping |
boolean |
isSwapped()
Check if this page table entry has been swapped out |
void |
setPhysical(cse378.address.PhysicalPage p)
Change the physical page represented by this mapping |
void |
setSwapped(boolean s)
|
void |
setTag(cse378.address.VirtualPage tag)
Change the virtual page represented by this mapping |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
swapped
protected boolean swapped
page
protected cse378.address.PhysicalPage page
count
static int count
PageTableEntry
public PageTableEntry(cse378.address.VirtualPage v,
cse378.address.PhysicalPage p)
getTag
public cse378.address.VirtualPage getTag()
- Get the virtual page represented by this mapping
- Overrides:
getTag
in class TaggedBlock
- Returns:
- VirtualPage
setTag
public void setTag(cse378.address.VirtualPage tag)
- Change the virtual page represented by this mapping
- Parameters:
tag
- new VirtualPage for this mapping
getPhysical
public cse378.address.PhysicalPage getPhysical()
- Get the physical page represented by this mapping
- Returns:
- PhysicalPage
setPhysical
public void setPhysical(cse378.address.PhysicalPage p)
- Change the physical page represented by this mapping
- Parameters:
tag
- new PhysicalPage for this mapping
isSwapped
public boolean isSwapped()
- Check if this page table entry has been swapped out
- Returns:
- true is its been swapped out
setSwapped
public void setSwapped(boolean s)
toString
public java.lang.String toString()
- Overrides:
toString
in class TaggedBlock