Source code: Allocator/MemUnit.java
1 // MemUnit.java, created Mon Nov 25 9:15:28 2002 by laudney
2 // Copyright (C) 2001-3 laudney <laudney@acm.org>
3 // Licensed under the terms of the GNU LGPL; see COPYING for details.
4 package Allocator;
5
6 import Memory.Address;
7
8 /**
9 * MemUnit
10 *
11 * @author laudney <laudney@acm.org>
12 * @version $Id: MemUnit.java,v 1.4 2003/05/12 10:04:52 joewhaley Exp $
13 */
14 public class MemUnit {
15 private Address head;
16 private int byteLength;
17
18 public MemUnit(Address head, int byteLength) {
19 this.head = head;
20 this.byteLength = byteLength;
21 }
22
23 public MemUnit(Address head, Address end) {
24 this(head, end.difference(head));
25 }
26
27 public Address getHead() {
28 return head;
29 }
30
31 public void setHead(Address head) {
32 this.head = head;
33 }
34
35 public int getByteLength() {
36 return byteLength;
37 }
38
39 public void setByteLength(int byteLength) {
40 this.byteLength = byteLength;
41 }
42 }