Class FTE

java.lang.Object
  |
  +--FTE

public class FTE
extends java.lang.Object

An FTE is a frame table entry.


Field Summary
 int frameNumber
          frameNumber is the frame number for this frame table entry.
 PCB owner
          owner is the process that owns the frame that is described by this frame table entry.
 int pageNumber
          pageNumber is the page number that is assigned to the frame that is described by this frame table entry.
 PTE pte
          pte is the page table entry that uses the frame that is described by this frame table entry.
 
Constructor Summary
FTE(int fn)
          new FTE(fn) returns a new frame table entry for frame number fn.
 
Method Summary
 void assign(PCB proc, PTE pte, int pageNum)
          fte.assign(proc, pte, pageNum) sets proc as the owner of fte, sets pte as its page table entry, and sets pageNum as its page number.
 PCB getOwner()
          fte.getOwner() returns the process that owns fte, or null if fte is free.
 int getPageNumber()
          fte.getPageNumber() returns the page number for the page that is assigned to fte, or -1 if fte is free.
 PTE getPTE()
          fte.getPTE() returns the page table entry for the page that is assigned to fte, or null if fte is free.
 boolean isFree()
          fte.isFree() returns true if fte is not assigned to any process.
 boolean isReferenced()
          fte.isReferenced() returns true if fte is assigned to a process and it has been referenced recently.
 void print(int frameNum)
          fte.print(frameNum) writes fte to System.out in tabular form.
static void printHeader()
          FTE.printHeader() writes a header for tables containing fte entries printed with the print() method.
 void resetReferenceBit()
          fte.resetReferenceBit() resets the reference bit in the PTE that uses fte.
 void setFree()
          fte.setFree() makes fte free.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

frameNumber

public int frameNumber
frameNumber is the frame number for this frame table entry.


owner

public PCB owner
owner is the process that owns the frame that is described by this frame table entry.


pte

public PTE pte
pte is the page table entry that uses the frame that is described by this frame table entry.


pageNumber

public int pageNumber
pageNumber is the page number that is assigned to the frame that is described by this frame table entry.

Constructor Detail

FTE

public FTE(int fn)
new FTE(fn) returns a new frame table entry for frame number fn. The frame is not assigned to any process.

Method Detail

getOwner

public PCB getOwner()
fte.getOwner() returns the process that owns fte, or null if fte is free.


getPTE

public PTE getPTE()
fte.getPTE() returns the page table entry for the page that is assigned to fte, or null if fte is free.


getPageNumber

public int getPageNumber()
fte.getPageNumber() returns the page number for the page that is assigned to fte, or -1 if fte is free.


setFree

public void setFree()
fte.setFree() makes fte free. The PTE for the page is updated.

Preconditions: fte.isFree() is false.


isFree

public boolean isFree()
fte.isFree() returns true if fte is not assigned to any process.


resetReferenceBit

public void resetReferenceBit()
fte.resetReferenceBit() resets the reference bit in the PTE that uses fte.

Preconditions: fte.isFree() is false.


isReferenced

public boolean isReferenced()
fte.isReferenced() returns true if fte is assigned to a process and it has been referenced recently.


assign

public void assign(PCB proc,
                   PTE pte,
                   int pageNum)
fte.assign(proc, pte, pageNum) sets proc as the owner of fte, sets pte as its page table entry, and sets pageNum as its page number.

Preconditions: fte.isFree() is true.


printHeader

public static void printHeader()
FTE.printHeader() writes a header for tables containing fte entries printed with the print() method.


print

public void print(int frameNum)
fte.print(frameNum) writes fte to System.out in tabular form. The frame number displayed for fte is frameNum.