memory-and-process-scheduler

git clone git://git.codymlewis.com/memory-and-process-scheduler.git
Log | Files | Refs | README

Memory.java (485B)


      1 import java.util.ArrayList;
      2 import java.util.Map;
      3 import java.util.HashMap;
      4 
      5 public class Memory {
      6     private class Page {
      7         int id;
      8 
      9         public Page(int id) {
     10             this.id = id;
     11         }
     12     }
     13 
     14     ArrayList<Page> frames;
     15     int maxFrames;
     16     Map<Integer, Integer> pageMap;
     17     FrameBuffer fbuffer;
     18 
     19     public Memory(int numberFrames) {
     20         maxFrames = numberFrames;
     21         frames = new ArrayList<>(numberFrames);
     22         pageMap = new HashMap<>();
     23     }
     24 }