Document unusual equals behaviour

This commit is contained in:
Arne Keller 2020-03-09 23:52:03 +01:00
parent ed615fcf6b
commit e0034200fb
2 changed files with 6 additions and 1 deletions

View File

@ -149,7 +149,7 @@ public final class Switch extends Rail {
}
/**
* Check whether two switches are equal, ignoring the current configuration.
* Check whether two switches are equal, ignoring the current configuration and their identifiers.
*
* @return whether this switch is equal to the other
*/

View File

@ -150,6 +150,11 @@ public final class Track extends Rail {
return String.format("t %d %s -> %s %d", getIdentifier(), start, end, getLength());
}
/**
* Check whether two tracks are equal, ignoring their identifiers.
*
* @return whether this track is equal to another
*/
@Override
public boolean equals(Object obj) {
if (obj != null && getClass().equals(obj.getClass())) {