Checkstyle

This commit is contained in:
Arne Keller 2020-02-18 20:47:51 +01:00
parent 137b8359c6
commit 7e28bdc446
9 changed files with 21 additions and 9 deletions

View File

@ -49,11 +49,11 @@ public class Coach extends RollingStock {
/**
* The type of this coach (passenger, freight or special). TODO: consider using three classes
*/
private CoachType type;
private final CoachType type;
/**
* The unique identifier of this coach.
*/
private int identifier;
private final int identifier;
/**
* Construct a new coach.

View File

@ -346,7 +346,7 @@ public class ModelRailwaySimulation {
*/
public void printTrains() {
if (trains.isEmpty()) {
Terminal.printLine("No train exists"); // TODO not in fucking spec
Terminal.printLine("No train exists");
return;
}
trains.values().forEach(Terminal::printLine);

View File

@ -11,7 +11,13 @@ import java.util.Objects;
* @version 1.0
*/
public final class Track extends Rail {
/**
* Where this track starts.
*/
private final Vector2D start;
/**
* Where this track ends.
*/
private final Vector2D end;
/**

View File

@ -253,7 +253,7 @@ public final class Train {
}
/**
* @return a set of the rails this train occupies
* @return a set of the rails this train occupies currently
*/
public Set<Rail> getOccupiedRails() {
// make sure caller can not modify internal state

View File

@ -26,11 +26,11 @@ public class TrainSet extends RollingStock {
/**
* Series (class) of this train set.
*/
private String series;
private final String series;
/**
* Name of this train set. TODO: create NamedRollingStock class
*/
private String name;
private final String name;
/**
* Construct a new train set.

View File

@ -15,11 +15,11 @@ public class AddTrack extends Command {
/**
* Start position of the new track.
*/
private Vector2D start;
private final Vector2D start;
/**
* End position of the new track.
*/
private Vector2D end;
private final Vector2D end;
/**
* Construct a new 'add track' command.

View File

@ -14,7 +14,7 @@ import java.util.regex.Pattern;
* @author Arne Keller
* @version 1.0
*/
public class CommandFactory {
public final class CommandFactory {
private static final String ADD_TRACK = "add track";
private static final Pattern ADD_TRACK_ARGUMENTS
= Pattern.compile(" \\(([+-]?\\d+,[+-]?\\d+)\\) -> \\(([+-]?\\d+,[+-]?\\d+)\\)");

View File

@ -9,6 +9,9 @@ import edu.kit.informatik.model.ModelRailwaySimulation;
* @version 1.0
*/
public class ShowTrain extends Command {
/**
* Identifier of the train to display.
*/
private final int id;
/**

View File

@ -9,6 +9,9 @@ import edu.kit.informatik.model.ModelRailwaySimulation;
* @version 1.0
*/
public class Step extends Command {
/**
* Amount of steps to perform (= speed).
*/
private final short speed;
/**