1
0
mirror of https://github.com/sethm/symon.git synced 2024-09-28 13:54:51 +00:00

Minor whitespace cleanup

This commit is contained in:
Seth Morabito 2016-06-11 11:46:31 -07:00
parent da88aadda2
commit 5a2e057e69

View File

@ -26,6 +26,7 @@ package com.loomcom.symon;
import com.loomcom.symon.devices.Device; import com.loomcom.symon.devices.Device;
import com.loomcom.symon.exceptions.MemoryAccessException; import com.loomcom.symon.exceptions.MemoryAccessException;
import com.loomcom.symon.exceptions.MemoryRangeException; import com.loomcom.symon.exceptions.MemoryRangeException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -80,9 +81,9 @@ public class Bus {
deviceAddressArray = new Device[size]; deviceAddressArray = new Device[size];
// getDevices() provides an OrderedSet with devices ordered by priorities // getDevices() provides an OrderedSet with devices ordered by priorities
for(Device device : getDevices()) { for (Device device : getDevices()) {
MemoryRange range = device.getMemoryRange(); 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; deviceAddressArray[address - this.startAddress] = device;
} }
} }
@ -137,7 +138,7 @@ public class Bus {
* @param device Device to remove * @param device Device to remove
*/ */
public void removeDevice(Device device) { public void removeDevice(Device device) {
for(SortedSet<Device> deviceSet : deviceMap.values()) { for (SortedSet<Device> deviceSet : deviceMap.values()) {
deviceSet.remove(device); deviceSet.remove(device);
} }
buildDeviceAddressArray(); buildDeviceAddressArray();
@ -154,12 +155,12 @@ public class Bus {
* device. * device.
*/ */
public boolean isComplete() { public boolean isComplete() {
if(deviceAddressArray == null) { if (deviceAddressArray == null) {
buildDeviceAddressArray(); buildDeviceAddressArray();
} }
for(int address = startAddress; address <= endAddress; ++address) { for (int address = startAddress; address <= endAddress; ++address) {
if(deviceAddressArray[address - startAddress] == null) { if (deviceAddressArray[address - startAddress] == null) {
return false; return false;
} }
} }
@ -169,7 +170,7 @@ public class Bus {
public int read(int address) throws MemoryAccessException { public int read(int address) throws MemoryAccessException {
Device d = deviceAddressArray[address - this.startAddress]; Device d = deviceAddressArray[address - this.startAddress];
if(d != null) { if (d != null) {
MemoryRange range = d.getMemoryRange(); MemoryRange range = d.getMemoryRange();
int devAddr = address - range.startAddress(); int devAddr = address - range.startAddress();
return d.read(devAddr) & 0xff; return d.read(devAddr) & 0xff;
@ -180,7 +181,7 @@ public class Bus {
public void write(int address, int value) throws MemoryAccessException { public void write(int address, int value) throws MemoryAccessException {
Device d = deviceAddressArray[address - this.startAddress]; Device d = deviceAddressArray[address - this.startAddress];
if(d != null) { if (d != null) {
MemoryRange range = d.getMemoryRange(); MemoryRange range = d.getMemoryRange();
int devAddr = address - range.startAddress(); int devAddr = address - range.startAddress();
d.write(devAddr, value); d.write(devAddr, value);