cse378.pagetable
Class PageTableEntry

java.lang.Object
  extended by cse378.AbstractBlock
      extended by cse378.TaggedBlock
          extended by 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
           
 
Fields inherited from class cse378.TaggedBlock
tag, tagBits
 
Fields inherited from class cse378.AbstractBlock
dirty, id, valid
 
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 cse378.TaggedBlock
hasTag, setTag, update
 
Methods inherited from class cse378.AbstractBlock
getId, hashCode, isDirty, isValid, setDirty, setValid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

swapped

protected boolean swapped

page

protected cse378.address.PhysicalPage page

count

static int count
Constructor Detail

PageTableEntry

public PageTableEntry(cse378.address.VirtualPage v,
                      cse378.address.PhysicalPage p)
Method Detail

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