Whitespace and indentation canonicalization. That's what I get for using two editors.

This commit is contained in:
Seth J. Morabito committed 2008-12-27 21:09:47 -08:00
1 parent d54ad18b17
commit 8bcd8a4a75
18 files changed
+5249 -5250

No files matched your search

@@ -9,65 +9,65 @@ import com.loomcom.symon.exceptions.*;
public abstract class Device implements Comparable<Device> {
/** The memory range for this device. */
private MemoryRange memoryRange;
/** The memory range for this device. */
private MemoryRange memoryRange;
/** The name of the device. */
private String name;
/** The name of the device. */
private String name;
/** Reference to the bus where this Device is attached. */
private Bus bus;
/** Reference to the bus where this Device is attached. */
private Bus bus;
public Device(int address, int size, String name)
throws MemoryRangeException {
this.memoryRange = new MemoryRange(address, address + size - 1);
this.name = name;
}
public Device(int address, int size, String name)
throws MemoryRangeException {
this.memoryRange = new MemoryRange(address, address + size - 1);
this.name = name;
}
public Device(int address, int size) throws MemoryRangeException {
this(address, size, null);
}
public Device(int address, int size) throws MemoryRangeException {
this(address, size, null);
}
/* Methods required to be implemented by inheriting classes. */
public abstract void write(int address, int data);
public abstract int read(int address);
public abstract String toString();
/* Methods required to be implemented by inheriting classes. */
public abstract void write(int address, int data);
public abstract int read(int address);
public abstract String toString();
public void setBus(Bus bus) {
this.bus = bus;
}
public void setBus(Bus bus) {
this.bus = bus;
}
public MemoryRange getMemoryRange() {
return memoryRange;
}
public MemoryRange getMemoryRange() {
return memoryRange;
}
public int endAddress() {
return memoryRange.endAddress();
}
public int endAddress() {
return memoryRange.endAddress();
}
public int startAddress() {
return memoryRange.startAddress();
}
public int startAddress() {
return memoryRange.startAddress();
}
public String getName() {
return name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public void setName(String name) {
this.name = name;
}
/**
* Compares two devices. The sort order is defined by the sort
* order of the device's memory ranges.
*/
public int compareTo(Device other) {
if (other == null) {
throw new NullPointerException("Cannot compare to null.");
}
if (this == other) {
return 0;
}
return getMemoryRange().compareTo(other.getMemoryRange());
}
/**
* Compares two devices. The sort order is defined by the sort
* order of the device's memory ranges.
*/
public int compareTo(Device other) {
if (other == null) {
throw new NullPointerException("Cannot compare to null.");
}
if (this == other) {
return 0;
}
return getMemoryRange().compareTo(other.getMemoryRange());
}
}
@@ -7,33 +7,33 @@ import com.loomcom.symon.exceptions.*;
public class Memory extends Device {
private boolean readOnly;
private int[] mem;
private boolean readOnly;
private int[] mem;
public Memory(int address, int size, boolean readOnly)
throws MemoryRangeException {
super(address, size, "RW Memory");
this.readOnly = readOnly;
this.mem = new int[size];
// Initialize all locations to 0xff
Arrays.fill(this.mem, 0xff);
}
public Memory(int address, int size, boolean readOnly)
throws MemoryRangeException {
super(address, size, "RW Memory");
this.readOnly = readOnly;
this.mem = new int[size];
// Initialize all locations to 0xff
Arrays.fill(this.mem, 0xff);
}
public Memory(int address, int size)
throws MemoryRangeException {
this(address, size, false);
}
public Memory(int address, int size)
throws MemoryRangeException {
this(address, size, false);
}
public void write(int address, int data) {
this.mem[address] = data;
}
public void write(int address, int data) {
this.mem[address] = data;
}
public int read(int address) {
return this.mem[address];
}
public int read(int address) {
return this.mem[address];
}
public String toString() {
return "Memory: " + getMemoryRange().toString();
}
public String toString() {
return "Memory: " + getMemoryRange().toString();
}
}