Create Device.size()

This commit is contained in:
Max840 committed 2013-12-24 15:35:56 -05:00
1 parent 1c9c742477
commit d8deca227f
2 files changed
+9 -1

No files matched your search

@@ -35,6 +35,9 @@ public abstract class Device implements Comparable<Device> {
/** The memory range for this device. */
private MemoryRange memoryRange;
/** Size of the device in memory **/
int size;
/** The name of the device. */
private String name;
@@ -44,6 +47,7 @@ public abstract class Device implements Comparable<Device> {
public Device(int startAddress, int endAddress, String name)
throws MemoryRangeException {
this.memoryRange = new MemoryRange(startAddress, endAddress);
this.size = endAddress - startAddress + 1;
this.name = name;
}
@@ -80,6 +84,10 @@ public abstract class Device implements Comparable<Device> {
return name;
}
public int getSize(){
return size;
}
public void setName(String name) {
this.name = name;
}