001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.data.gpx;
003
004import java.util.Collection;
005import java.util.LinkedList;
006
007public class GpxRoute extends WithAttributes {
008    public Collection<WayPoint> routePoints = new LinkedList<>();
009
010    @Override
011    public int hashCode() {
012        return 31 * super.hashCode() + ((routePoints == null) ? 0 : routePoints.hashCode());
013    }
014
015    @Override
016    public boolean equals(Object obj) {
017        if (this == obj)
018            return true;
019        if (!super.equals(obj))
020            return false;
021        if (getClass() != obj.getClass())
022            return false;
023        GpxRoute other = (GpxRoute) obj;
024        if (routePoints == null) {
025            if (other.routePoints != null)
026                return false;
027        } else if (!routePoints.equals(other.routePoints))
028            return false;
029        return true;
030    }
031}