From 9cc4ba0015b50b49f58933ce93580b98959cf7fc Mon Sep 17 00:00:00 2001 From: Arne Keller Date: Sat, 15 Feb 2020 16:11:13 +0100 Subject: [PATCH] Checkstyle --- src/edu/kit/informatik/DieselEngine.java | 35 +++++++++++++------ src/edu/kit/informatik/ElectricalEngine.java | 36 ++++++++++++++------ src/edu/kit/informatik/Rail.java | 3 ++ src/edu/kit/informatik/SteamEngine.java | 35 +++++++++++++------ 4 files changed, 78 insertions(+), 31 deletions(-) diff --git a/src/edu/kit/informatik/DieselEngine.java b/src/edu/kit/informatik/DieselEngine.java index 27fd6dc..64b2eb9 100644 --- a/src/edu/kit/informatik/DieselEngine.java +++ b/src/edu/kit/informatik/DieselEngine.java @@ -1,7 +1,31 @@ package edu.kit.informatik; +/** + * Diesel engine. + * + * @author Arne Keller + * @version 1.0 + */ public class DieselEngine extends Engine { - public DieselEngine(final String series, final String name, final int length, final boolean couplingFront, final boolean couplingBack) { + private static final String[] DIESEL_ENGINE_TEXT = new String[] { + " _____________|____ ", + " /_| ____________ |_\\ ", + "/ |____________| \\", + "\\ /", + " \\__________________/ ", + " (O)(O) (O)(O) ", + }; + + /** + * Construct a new diesel engine. + * @param series series/class of engine + * @param name name of engine + * @param length length of engine + * @param couplingFront whether the engine should have a front coupling + * @param couplingBack whether the engine should have a back coupling + */ + public DieselEngine(final String series, final String name, final int length, + final boolean couplingFront, final boolean couplingBack) { super.name = name; super.series = series; super.length = length; @@ -14,15 +38,6 @@ public class DieselEngine extends Engine { return String.format("d %s %s %d %b %b", series, name, length, couplingFront, couplingBack); } - private static final String[] DIESEL_ENGINE_TEXT = new String[] { - " _____________|____ ", - " /_| ____________ |_\\ ", - "/ |____________| \\", - "\\ /", - " \\__________________/ ", - " (O)(O) (O)(O) ", - }; - @Override public String[] textRepresentation() { return DIESEL_ENGINE_TEXT; diff --git a/src/edu/kit/informatik/ElectricalEngine.java b/src/edu/kit/informatik/ElectricalEngine.java index c213ac7..242d024 100644 --- a/src/edu/kit/informatik/ElectricalEngine.java +++ b/src/edu/kit/informatik/ElectricalEngine.java @@ -1,6 +1,31 @@ package edu.kit.informatik; +/** + * Electrical engine. + * + * @author Arne Keller + * @version 1.0 + */ public class ElectricalEngine extends Engine { + private static final String[] ELECTRICAL_ENGINE_TEXT = new String[] { + " ___ ", + " \\ ", + " _______________/__ ", + " /_| ____________ |_\\ ", + "/ |____________| \\", + "\\ /", + " \\__________________/ ", + " (O)(O) (O)(O) ", + }; + + /** + * Construct a new electrical engine. + * @param series series/class of engine + * @param name name of engine + * @param length length of engine + * @param couplingFront whether the engine should have a front coupling + * @param couplingBack whether the engine should have a back coupling + */ public ElectricalEngine(final String series, final String name, final int length, final boolean couplingFront, final boolean couplingBack) { super.name = name; super.series = series; @@ -14,17 +39,6 @@ public class ElectricalEngine extends Engine { return String.format("e %s %s %d %b %b", series, name, length, couplingFront, couplingBack); } - private static final String[] ELECTRICAL_ENGINE_TEXT = new String[] { - " ___ ", - " \\ ", - " _______________/__ ", - " /_| ____________ |_\\ ", - "/ |____________| \\", - "\\ /", - " \\__________________/ ", - " (O)(O) (O)(O) ", - }; - @Override public String[] textRepresentation() { return ELECTRICAL_ENGINE_TEXT; diff --git a/src/edu/kit/informatik/Rail.java b/src/edu/kit/informatik/Rail.java index d50998e..c6818a0 100644 --- a/src/edu/kit/informatik/Rail.java +++ b/src/edu/kit/informatik/Rail.java @@ -2,6 +2,9 @@ package edu.kit.informatik; /** * Generic rail that other rails can connect to. + * + * @author Arne Keller + * @version 1.0 */ public abstract class Rail { protected int id; diff --git a/src/edu/kit/informatik/SteamEngine.java b/src/edu/kit/informatik/SteamEngine.java index a7d4090..4b11fea 100644 --- a/src/edu/kit/informatik/SteamEngine.java +++ b/src/edu/kit/informatik/SteamEngine.java @@ -1,7 +1,31 @@ package edu.kit.informatik; +/** + * Steam engine. + * + * @author Arne Keller + * @version 1.0 + */ public class SteamEngine extends Engine { - public SteamEngine(final String series, final String name, final int length, final boolean couplingFront, final boolean couplingBack) { + private static final String[] STEAM_ENGINE_TEXT = new String[] { + " ++ +------", + " || |+-+ | ", + " /---------|| | | ", + " + ======== +-+ | ", + " _|--/~\\------/~\\-+ ", + "//// \\_/ \\_/ " + }; + + /** + * Construct a new steam engine. + * @param series series/class of engine + * @param name name of engine + * @param length length of engine + * @param couplingFront whether the engine should have a front coupling + * @param couplingBack whether the engine should have a back coupling + */ + public SteamEngine(final String series, final String name, final int length, + final boolean couplingFront, final boolean couplingBack) { super.name = name; super.series = series; super.length = length; @@ -14,15 +38,6 @@ public class SteamEngine extends Engine { return String.format("s %s %s %d %b %b", series, name, length, couplingFront, couplingBack); } - private static final String[] STEAM_ENGINE_TEXT = new String[] { - " ++ +------", - " || |+-+ | ", - " /---------|| | | ", - " + ======== +-+ | ", - " _|--/~\\------/~\\-+ ", - "//// \\_/ \\_/ " - }; - @Override public String[] textRepresentation() { return STEAM_ENGINE_TEXT;