Checkstyle

This commit is contained in:
Arne Keller 2020-03-04 20:14:47 +01:00
parent 840c29f000
commit 428e1862fc
2 changed files with 12 additions and 3 deletions

View File

@ -3,7 +3,7 @@ package edu.kit.informatik.model;
import edu.kit.informatik.ui.InvalidInputException; import edu.kit.informatik.ui.InvalidInputException;
/** /**
* A rolling stock. Is usually an engine, train set or coach. * A rolling stock with a specific integer length and couplings. Is usually an engine, train set or coach.
* *
* @author Arne Keller * @author Arne Keller
* @version 1.0 * @version 1.0
@ -24,6 +24,7 @@ public abstract class RollingStock {
/** /**
* Initialize a rolling stock. * Initialize a rolling stock.
*
* @param length length of this rolling stock * @param length length of this rolling stock
* @param couplingFront whether this rolling stock should have a front coupling * @param couplingFront whether this rolling stock should have a front coupling
* @param couplingBack whether this rolling stock should have a back coupling * @param couplingBack whether this rolling stock should have a back coupling
@ -43,6 +44,8 @@ public abstract class RollingStock {
} }
/** /**
* Get the identifier of this rolling stock.
*
* @return identifier of this rolling stock * @return identifier of this rolling stock
*/ */
public abstract String getIdentifier(); public abstract String getIdentifier();

View File

@ -343,6 +343,7 @@ public final class Train {
/** /**
* Update the direction of this train. * Update the direction of this train.
*
* @param newDirection new direction of the train * @param newDirection new direction of the train
*/ */
public void setDirection(final Vector2D newDirection) { public void setDirection(final Vector2D newDirection) {
@ -369,6 +370,8 @@ public final class Train {
} }
/** /**
* Check if this train is on the specified position. This includes the front and back of the train.
*
* @param point position to check * @param point position to check
* @return whether this train is on the specified position * @return whether this train is on the specified position
*/ */
@ -377,15 +380,18 @@ public final class Train {
} }
/** /**
* Check if this train is on any of the provided positions. This includes the front and back of the train.
*
* @param positions list of positions to check * @param positions list of positions to check
* @return whether this train is on any of the specified positions * @return whether this train is on any of the specified positions
*/ */
public boolean isOnAnyPosition(final List<Vector2D> positions) { public boolean isOnAnyPosition(List<Vector2D> positions) {
return position != null && position.stream().anyMatch(positions::contains); return position != null && position.stream().anyMatch(positions::contains);
} }
/** /**
* Calculate the length of this train, summing the length of all rolling stocks. * Calculate the length of this train, summing the length of all rolling stocks.
*
* @return total length of this train * @return total length of this train
*/ */
public long getLength() { public long getLength() {