diff options
| author | Paul Buetow <paul@buetow.org> | 2008-08-07 22:09:42 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-08-07 22:09:42 +0000 |
| commit | 35e3bca5989558441813f49f359cc5d9a83e96c3 (patch) | |
| tree | ca9d677db0a4558b093348e0cec702a1492315d4 | |
| parent | 2a74626954f00f3403b10c2a5160c0c4d1814aad (diff) | |
codelinelength and formatted
| -rw-r--r-- | LaTeX/chapters/implementierung.tex | 2 | ||||
| -rw-r--r-- | sources/core/VSAbstractProcess.java | 12 | ||||
| -rw-r--r-- | sources/core/VSInternalProcess.java | 18 | ||||
| -rw-r--r-- | sources/core/VSMessage.java | 2 | ||||
| -rw-r--r-- | sources/core/VSMessageStub.java | 6 | ||||
| -rw-r--r-- | sources/core/VSTask.java | 7 | ||||
| -rw-r--r-- | sources/events/VSRegisteredEvents.java | 2 | ||||
| -rw-r--r-- | sources/events/internal/VSProtocolEvent.java | 2 | ||||
| -rw-r--r-- | sources/prefs/editors/VSAbstractBetterEditor.java | 2 | ||||
| -rw-r--r-- | sources/protocols/VSAbstractProtocol.java | 20 | ||||
| -rw-r--r-- | sources/simulator/VSSimulator.java | 6 | ||||
| -rw-r--r-- | sources/simulator/VSSimulatorCanvas.java | 9 |
12 files changed, 48 insertions, 40 deletions
diff --git a/LaTeX/chapters/implementierung.tex b/LaTeX/chapters/implementierung.tex index 7b273a6..b24cbe8 100644 --- a/LaTeX/chapters/implementierung.tex +++ b/LaTeX/chapters/implementierung.tex @@ -26,7 +26,7 @@ In diesem Kapitel wird auf die Implementierung des Simulators eingegangen. Der S \label{tb:Pakete}
\end{table}
-Da es sonst den Rahmen sprengen w\"{u}rde, soll im Folgenden der komplette Quelltext nicht bis in das letzte Detail behandelt werden. Der Quelltext erstreckt sich n\"{a}mlich, einschließlich Kommentare, auf \"{u}ber 15.000 Zeilen und \"{u}ber 60 Dateien. Zudem ist die generierte Quelltext-Dokumentation (Javadoc) \"{u}ber 2MB groß. Alle folgenden UML-Diagramme stellen aufgrund der \"{U}bersichtlichkeit lediglich die wesentlichen Dinge dar. Alle Details lassen sich im Quelltext und der dazugeh\"{o}rigen Dokumentation einsehen. Die Paketstruktur des Quelltextes ist in Tabelle \ref{tb:Pakete} in alphanumerischer Reihenfolge aufgef\"{u}hrt.
+Da es sonst den Rahmen sprengen w\"{u}rde, soll im Folgenden der komplette Quelltext nicht bis in das letzte Detail behandelt werden. Der Quelltext erstreckt sich n\"{a}mlich, einschließlich Kommentare, auf \"{u}ber 15.000 Zeilen und \"{u}ber 59 Dateien. Zudem ist die generierte Quelltext-Dokumentation (Javadoc) \"{u}ber 2MB groß. Alle folgenden UML-Diagramme stellen aufgrund der \"{U}bersichtlichkeit lediglich die wesentlichen Dinge dar. Alle Details lassen sich im Quelltext und der dazugeh\"{o}rigen Dokumentation einsehen. Die Paketstruktur des Quelltextes ist in Tabelle \ref{tb:Pakete} in alphanumerischer Reihenfolge aufgef\"{u}hrt.
\section{Programmierrichtlinien}
diff --git a/sources/core/VSAbstractProcess.java b/sources/core/VSAbstractProcess.java index 4c500ea..638ad53 100644 --- a/sources/core/VSAbstractProcess.java +++ b/sources/core/VSAbstractProcess.java @@ -92,8 +92,8 @@ public abstract class VSAbstractProcess extends VSPrefs /** The tasks of the process. DO ONLY MANIPULATE THIS OBJECT WITHIN THE * VSTaskManager CLASS! OTHERWISE THE SYNCHRONIZATION IS WRONG! Use the - * VSAbstractProcess.getTasks() method to get a reference to this object within the - * VSTaskManager! */ + * VSAbstractProcess.getTasks() method to get a reference to this object + * within the VSTaskManager! */ protected VSPriorityQueue<VSTask> tasks; /** The process has crashed. But may be working again. */ @@ -200,7 +200,8 @@ public abstract class VSAbstractProcess extends VSPrefs * @param logging the logging object */ public VSAbstractProcess(VSPrefs prefs, int processNum, - VSSimulatorCanvas simulatorCanvas, VSLogging logging) { + VSSimulatorCanvas simulatorCanvas, + VSLogging logging) { init(prefs, processNum, simulatorCanvas, logging); } @@ -666,7 +667,8 @@ public abstract class VSAbstractProcess extends VSPrefs super.serialize(serialize, objectOutputStream); if (VSSerialize.DEBUG) - System.out.println("Serializing: VSAbstractProcess (num: " + processNum + System.out.println("Serializing: VSAbstractProcess (num: " + + processNum + "; id: " + processID + ")"); /** For later backwards compatibility, to add more stuff */ @@ -746,5 +748,5 @@ public abstract class VSAbstractProcess extends VSPrefs * @see core.VSInternalMessage#getProtocolObjekt(java.util.String) */ protected abstract VSAbstractProtocol getProtocolObject_( - String protocolClassname); + String protocolClassname); } diff --git a/sources/core/VSInternalProcess.java b/sources/core/VSInternalProcess.java index df70cc8..9311d0a 100644 --- a/sources/core/VSInternalProcess.java +++ b/sources/core/VSInternalProcess.java @@ -37,8 +37,8 @@ import simulator.*; import utils.*; /** - * The class VSInternalProcess, an object of this class represents a process of a - * simulator. + * The class VSInternalProcess, an object of this class represents a process + * of a simulator. * * @author Paul C. Buetow */ @@ -52,7 +52,8 @@ public class VSInternalProcess extends VSAbstractProcess { * @param logging the logging object */ public VSInternalProcess(VSPrefs prefs, int processNum, - VSSimulatorCanvas simulatorCanvas, VSLogging logging) { + VSSimulatorCanvas simulatorCanvas, + VSLogging logging) { super(prefs, processNum, simulatorCanvas, logging); } @@ -143,9 +144,10 @@ public class VSInternalProcess extends VSAbstractProcess { /** * Creates the random crash task. The crash task will be created only if - * the process is not crashed atm. and if VSInternalProcess.getARandomCrashTime() - * returns a non-negative value. The random crash task uses the simulaion's - * global time for its scheduling. + * the process is not crashed atm. and if + * VSInternalProcess.getARandomCrashTime() * returns a non-negative value. + * The random crash task uses the simulaion's global time for its + * scheduling. */ public synchronized void createRandomCrashTask() { if (!isCrashed) { @@ -291,7 +293,7 @@ public class VSInternalProcess extends VSAbstractProcess { * will not get lost at all. */ public synchronized long getARandomMessageOutageTime(long durationTime, - VSInternalProcess receiverProcess) { + VSInternalProcess receiverProcess) { int percentage = (int) ((getInteger("message.prob.outage") + receiverProcess.getInteger( "message.prob.outage")) / 2); @@ -404,7 +406,7 @@ public class VSInternalProcess extends VSAbstractProcess { * @return the protocol object */ public synchronized VSAbstractProtocol getProtocolObject( - String protocolClassname) { + String protocolClassname) { VSAbstractProtocol protocol = null; if (!objectExists(protocolClassname)) { diff --git a/sources/core/VSMessage.java b/sources/core/VSMessage.java index 388f3d0..c896828 100644 --- a/sources/core/VSMessage.java +++ b/sources/core/VSMessage.java @@ -94,7 +94,7 @@ public class VSMessage extends VSPrefs { * @param isServerMessage Sets if the message has been sent by a server. */ void init(VSInternalProcess process, String protocolClassname, - boolean isServerMessage) { + boolean isServerMessage) { this.sendingProcess = process; this.protocolClassname = protocolClassname; this.isServerMessage = isServerMessage; diff --git a/sources/core/VSMessageStub.java b/sources/core/VSMessageStub.java index eaa8929..b320fa0 100644 --- a/sources/core/VSMessageStub.java +++ b/sources/core/VSMessageStub.java @@ -43,8 +43,8 @@ public class VSMessageStub { /** * The constructor of the message stub. Creates a new message stub object. - * - * @param message the message + * + * @param message the message */ public VSMessageStub(VSMessage message) { this.message = message; @@ -55,7 +55,7 @@ public class VSMessageStub { */ public void init(VSInternalProcess process, String protocolClassname, boolean isServerMessage) { - message.init(process, protocolClassname, isServerMessage); + message.init(process, protocolClassname, isServerMessage); } } diff --git a/sources/core/VSTask.java b/sources/core/VSTask.java index 285e52c..3a16593 100644 --- a/sources/core/VSTask.java +++ b/sources/core/VSTask.java @@ -91,7 +91,8 @@ public class VSTask implements Comparable, VSSerializable { * @param event the event * @param isLocal the taks is local timed */ - public VSTask(long taskTime, VSInternalProcess process, VSAbstractEvent event, + public VSTask(long taskTime, VSInternalProcess process, + VSAbstractEvent event, boolean isLocal) { init(taskTime, process, event, isLocal); } @@ -137,8 +138,8 @@ public class VSTask implements Comparable, VSSerializable { * @param event the event * @param isLocal the taks is local timed */ - private void init(long taskTime, VSInternalProcess process, VSAbstractEvent event, - boolean isLocal) { + private void init(long taskTime, VSInternalProcess process, + VSAbstractEvent event, boolean isLocal) { this.process = process; this.taskTime = taskTime > 0 ? taskTime : 0; /* May be not null if called from deserialization */ diff --git a/sources/events/VSRegisteredEvents.java b/sources/events/VSRegisteredEvents.java index 801a8c2..edb1e31 100644 --- a/sources/events/VSRegisteredEvents.java +++ b/sources/events/VSRegisteredEvents.java @@ -355,7 +355,7 @@ public final class VSRegisteredEvents { * @param eventName the event name */ private static void registerEvent(String eventClassname, String eventName) { - registerEvent(eventClassname, eventName, null); + registerEvent(eventClassname, eventName, null); } /** diff --git a/sources/events/internal/VSProtocolEvent.java b/sources/events/internal/VSProtocolEvent.java index 76caff0..4563493 100644 --- a/sources/events/internal/VSProtocolEvent.java +++ b/sources/events/internal/VSProtocolEvent.java @@ -124,7 +124,7 @@ public class VSProtocolEvent extends VSAbstractInternalEvent * @see events.VSAbstractEvent#onStart() */ public void onStart() { - VSInternalProcess internalProcess = (VSInternalProcess) process; + VSInternalProcess internalProcess = (VSInternalProcess) process; VSAbstractProtocol protocol = internalProcess.getProtocolObject(protocolClassname); diff --git a/sources/prefs/editors/VSAbstractBetterEditor.java b/sources/prefs/editors/VSAbstractBetterEditor.java index e1a605d..9092e3e 100644 --- a/sources/prefs/editors/VSAbstractBetterEditor.java +++ b/sources/prefs/editors/VSAbstractBetterEditor.java @@ -135,6 +135,6 @@ public abstract class VSAbstractBetterEditor extends VSAbstractEditor { * @return the info area */ //protected VSInfoArea getInfoArea() { - // return infoArea; + // return infoArea; //} } diff --git a/sources/protocols/VSAbstractProtocol.java b/sources/protocols/VSAbstractProtocol.java index 603bb1d..cea2856 100644 --- a/sources/protocols/VSAbstractProtocol.java +++ b/sources/protocols/VSAbstractProtocol.java @@ -95,15 +95,15 @@ abstract public class VSAbstractProtocol extends VSAbstractEvent { process.increaseLamportTime(); process.increaseVectorTime(); - VSMessageStub stub = new VSMessageStub(message); - VSInternalProcess internalProcess = (VSInternalProcess) process; + VSMessageStub stub = new VSMessageStub(message); + VSInternalProcess internalProcess = (VSInternalProcess) process; if (currentContextIsServer) - stub.init(internalProcess, getClassname(), - VSMessage.IS_SERVER_MESSAGE); + stub.init(internalProcess, getClassname(), + VSMessage.IS_SERVER_MESSAGE); else - stub.init(internalProcess, getClassname(), - VSMessage.IS_CLIENT_MESSAGE); + stub.init(internalProcess, getClassname(), + VSMessage.IS_CLIENT_MESSAGE); internalProcess.sendMessage(message); } @@ -303,7 +303,7 @@ abstract public class VSAbstractProtocol extends VSAbstractEvent { * @param time The process' local time to run the schedule at. */ public final void scheduleAt(long time) { - VSInternalProcess internalProcess = (VSInternalProcess) process; + VSInternalProcess internalProcess = (VSInternalProcess) process; VSAbstractEvent scheduleEvent = new VSProtocolScheduleEvent(this, currentContextIsServer); VSTask scheduleTask = @@ -315,14 +315,14 @@ abstract public class VSAbstractProtocol extends VSAbstractEvent { clientSchedules.add(scheduleTask); VSSimulatorCanvas canvas = internalProcess.getSimulatorCanvas(); - canvas.getTaskManager().addTask(scheduleTask); + canvas.getTaskManager().addTask(scheduleTask); } /** * Removes all schedules of the protocol (server or client) */ public final void removeSchedules() { - VSInternalProcess internalProcess = (VSInternalProcess) process; + VSInternalProcess internalProcess = (VSInternalProcess) process; if (currentContextIsServer) { internalProcess.getSimulatorCanvas(). @@ -399,7 +399,7 @@ abstract public class VSAbstractProtocol extends VSAbstractEvent { if (process == null) return 0; - VSInternalProcess internalProcess = (VSInternalProcess) process; + VSInternalProcess internalProcess = (VSInternalProcess) process; return internalProcess.getSimulatorCanvas().getNumProcesses(); } diff --git a/sources/simulator/VSSimulator.java b/sources/simulator/VSSimulator.java index 31b5631..feaf197 100644 --- a/sources/simulator/VSSimulator.java +++ b/sources/simulator/VSSimulator.java @@ -212,7 +212,8 @@ public class VSSimulator extends JPanel implements VSSerializable { * @param localTask true, if this table manages the local task. false, * if this table manages the global tasks. */ - public VSTaskManagerTableModel(VSInternalProcess process, boolean localTask) { + public VSTaskManagerTableModel(VSInternalProcess process, + boolean localTask) { tasks = new ArrayList<VSTask>(); set(process, localTask, ONE_PROCESS); columnNames = new String[3]; @@ -1279,7 +1280,8 @@ public class VSSimulator extends JPanel implements VSSerializable { * * @return the concerned processes */ - private ArrayList<VSInternalProcess> getConcernedProcesses(boolean localTasks) { + private ArrayList<VSInternalProcess> getConcernedProcesses( + boolean localTasks) { int processNum = localTasks ? localPIDComboBox.getSelectedIndex() : globalPIDComboBox.getSelectedIndex(); diff --git a/sources/simulator/VSSimulatorCanvas.java b/sources/simulator/VSSimulatorCanvas.java index d5506ba..106e2f8 100644 --- a/sources/simulator/VSSimulatorCanvas.java +++ b/sources/simulator/VSSimulatorCanvas.java @@ -1485,9 +1485,9 @@ public class VSSimulatorCanvas extends Canvas durationTime = sendingProcess.getDurationTime(); if (prefs.getBoolean("sim.message.sendingtime.mean")) { - durationTime += receiverProcess.getDurationTime(); - durationTime /= 2; - } + durationTime += receiverProcess.getDurationTime(); + durationTime /= 2; + } deliverTime = sendingProcess.getGlobalTime() + durationTime; @@ -1675,7 +1675,8 @@ public class VSSimulatorCanvas extends Canvas * @return the new process */ private VSInternalProcess createProcess(int processNum) { - VSInternalProcess process = new VSInternalProcess(prefs, processNum, this, logging); + VSInternalProcess process = + new VSInternalProcess(prefs, processNum, this, logging); logging.logg(prefs.getString("lang.process.new") + "; " + process); return process; } |
