Whitespace and indentation canonicalization. That's what I get for using two editors.
This commit is contained in:
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());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user