|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--Strategie.ReplaceStrategy
This class is an abstract class to work as a template for implementations of page replacement strategies. It contains detailed information about the implemented strategy like a short- and a long-name, switches to indicate whether some page-properties (time of access, time of insertion...) are important or not. These informations are needed to select the page that has to be replaced and are also needed by the drawing methods of the GUI to show only important informations.
| Field Summary | |
private boolean |
isAccessCount
Is number of accesses relevant for this strategy? |
private boolean |
isAccessTime
Is last time of accesses relevant for this strategy? |
private boolean |
isInsertTime
Is time of insertion relevant for this strategy? |
private boolean |
isShowMemoryDetails
Are memory details shown? |
private java.lang.String |
longName
Long name of the strategy. |
private int |
modifyBitCount
Number of modified-bits |
private int |
referenceBitCount
Number of reference-bits |
private java.lang.String |
shortName
Short name of the strategy. |
| Constructor Summary | |
ReplaceStrategy(java.lang.String sName,
java.lang.String lName,
int refBitCount,
int modBitCount,
boolean isAccessCount,
boolean isAccessTime,
boolean isInsertTime,
boolean isShowMemoryDetails)
Creates a new instance of this strategy |
|
| Method Summary | |
Memory |
createMemory(int size,
int refBits,
int modBits)
Creates a new memory structure with the given size and number of reference- and modifyBits. |
int |
getDrawLfdNr(Memory memory,
int i)
Returns the index of the frame i in memory structure. |
java.lang.String |
getLongName()
Returns the long name of this strategy. |
int |
getModifyBitCount()
Returns the number of modifyBits needed by this strategy. |
int |
getReferenceBitCount()
Returns the number of referenceBits needed by this strategy. |
java.lang.String |
getShortName()
Returns the short name of this strategy. |
Page |
getVictimPage(Memory memory,
SimuData simu,
GUI gui)
Selects the next victim page to the individual strategy criteria. |
boolean |
isAccessCount()
Returns true, if the number of access to the pages is relevant for this strategy. |
boolean |
isAccessTime()
Returns true, if the time of access to the pages is relevant for this strategy. |
boolean |
isInsertTime()
Returns true, if the time of insertion to the pages is relevant for this strategy. |
boolean |
isModifyBit()
Returns true, if the modify bit relevant for this strategy. |
boolean |
isReferenceBit()
Returns true, if the reference bit relevant for this strategy. |
boolean |
isShowMemoryDetails()
Returns true, if memory details should be shown. |
void |
reInsertPage(Memory memory,
Page reInsertPage,
SimuData simu,
GUI gui)
Reinserts a page into memory. |
void |
replacePage(Memory memory,
Page oldPage,
Page newPage,
SimuData simu,
GUI gui)
Replaces the oldPage by the newPage in memory. |
void |
setInitVictimPointer(Memory memory)
Sets the indexpointer to the page that has to be placed first. |
void |
setShowMemoryDetails(boolean isShowMemoryDetails)
Sets the memory details to "show" or "hide". |
void |
sortMemory(Memory memory)
Sorts the internal memory structure to the needs of the implemented strategy. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private java.lang.String shortName
private java.lang.String longName
private boolean isAccessCount
private boolean isAccessTime
private boolean isInsertTime
private boolean isShowMemoryDetails
private int referenceBitCount
private int modifyBitCount
| Constructor Detail |
public ReplaceStrategy(java.lang.String sName,
java.lang.String lName,
int refBitCount,
int modBitCount,
boolean isAccessCount,
boolean isAccessTime,
boolean isInsertTime,
boolean isShowMemoryDetails)
| Method Detail |
public Memory createMemory(int size,
int refBits,
int modBits)
public java.lang.String getShortName()
public java.lang.String getLongName()
public int getReferenceBitCount()
public int getModifyBitCount()
public boolean isAccessCount()
public boolean isAccessTime()
public boolean isInsertTime()
public boolean isModifyBit()
public boolean isReferenceBit()
public boolean isShowMemoryDetails()
public void setShowMemoryDetails(boolean isShowMemoryDetails)
public void setInitVictimPointer(Memory memory)
public void sortMemory(Memory memory)
public int getDrawLfdNr(Memory memory,
int i)
public Page getVictimPage(Memory memory,
SimuData simu,
GUI gui)
public void reInsertPage(Memory memory,
Page reInsertPage,
SimuData simu,
GUI gui)
public void replacePage(Memory memory,
Page oldPage,
Page newPage,
SimuData simu,
GUI gui)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||