Minor whitespace cleanup
This commit is contained in:
1 parent
da88aadda2
commit
5a2e057e69
1 file changed
+10
-9
@@ -26,6 +26,7 @@ package com.loomcom.symon;
|
||||
import com.loomcom.symon.devices.Device;
|
||||
import com.loomcom.symon.exceptions.MemoryAccessException;
|
||||
import com.loomcom.symon.exceptions.MemoryRangeException;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -80,9 +81,9 @@ public class Bus {
|
||||
deviceAddressArray = new Device[size];
|
||||
|
||||
// getDevices() provides an OrderedSet with devices ordered by priorities
|
||||
for(Device device : getDevices()) {
|
||||
for (Device device : getDevices()) {
|
||||
MemoryRange range = device.getMemoryRange();
|
||||
for(int address = range.startAddress; address <= range.endAddress; ++address) {
|
||||
for (int address = range.startAddress; address <= range.endAddress; ++address) {
|
||||
deviceAddressArray[address - this.startAddress] = device;
|
||||
}
|
||||
}
|
||||
@@ -92,7 +93,7 @@ public class Bus {
|
||||
/**
|
||||
* Add a device to the bus.
|
||||
*
|
||||
* @param device Device to add
|
||||
* @param device Device to add
|
||||
* @param priority Bus prioirity.
|
||||
* @throws MemoryRangeException
|
||||
*/
|
||||
@@ -137,7 +138,7 @@ public class Bus {
|
||||
* @param device Device to remove
|
||||
*/
|
||||
public void removeDevice(Device device) {
|
||||
for(SortedSet<Device> deviceSet : deviceMap.values()) {
|
||||
for (SortedSet<Device> deviceSet : deviceMap.values()) {
|
||||
deviceSet.remove(device);
|
||||
}
|
||||
buildDeviceAddressArray();
|
||||
@@ -154,12 +155,12 @@ public class Bus {
|
||||
* device.
|
||||
*/
|
||||
public boolean isComplete() {
|
||||
if(deviceAddressArray == null) {
|
||||
if (deviceAddressArray == null) {
|
||||
buildDeviceAddressArray();
|
||||
}
|
||||
|
||||
for(int address = startAddress; address <= endAddress; ++address) {
|
||||
if(deviceAddressArray[address - startAddress] == null) {
|
||||
for (int address = startAddress; address <= endAddress; ++address) {
|
||||
if (deviceAddressArray[address - startAddress] == null) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -169,7 +170,7 @@ public class Bus {
|
||||
|
||||
public int read(int address) throws MemoryAccessException {
|
||||
Device d = deviceAddressArray[address - this.startAddress];
|
||||
if(d != null) {
|
||||
if (d != null) {
|
||||
MemoryRange range = d.getMemoryRange();
|
||||
int devAddr = address - range.startAddress();
|
||||
return d.read(devAddr) & 0xff;
|
||||
@@ -180,7 +181,7 @@ public class Bus {
|
||||
|
||||
public void write(int address, int value) throws MemoryAccessException {
|
||||
Device d = deviceAddressArray[address - this.startAddress];
|
||||
if(d != null) {
|
||||
if (d != null) {
|
||||
MemoryRange range = d.getMemoryRange();
|
||||
int devAddr = address - range.startAddress();
|
||||
d.write(devAddr, value);
|
||||
|
||||
Reference in new issue
Block a user