- private BitVector[] memory;
-
- public Page()
- {
- memory = new BitVector[pageSize];
- }
-
- public BitVector getCell(int index)
- {
- BitVector b = memory[index];
- if (b == null)
- return BitVector.of(Bit.U, cellWidth);
- return memory[index];
- }
-
- public void setCell(int index, BitVector bits)
- {
- if (bits.length() != cellWidth)
- throw new IllegalArgumentException(String.format(
- "BitVector to be saved in memory cell has unexpected length. Expected: %d Actual: %d", cellWidth, bits.length()));
- memory[index] = bits;
- }