source: josm/trunk/src/org/openstreetmap/josm/data/gpx/GpxRoute.java@ 13536

Last change on this file since 13536 was 12186, checked in by michael2402, 7 years ago

See #14794: Add javadoc for all gpx classes.

  • Property svn:eol-style set to native
File size: 1.1 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.gpx;
3
4import java.util.Collection;
5import java.util.LinkedList;
6
7/**
8 * A route is a part of a GPX file containing of multiple GPX points.
9 */
10public class GpxRoute extends WithAttributes {
11 /**
12 * The points this route consists of. Should not be changed after creation.
13 * <p>
14 * This collection is ordered.
15 */
16 public Collection<WayPoint> routePoints = new LinkedList<>();
17
18 @Override
19 public int hashCode() {
20 return 31 * super.hashCode() + ((routePoints == null) ? 0 : routePoints.hashCode());
21 }
22
23 @Override
24 public boolean equals(Object obj) {
25 if (this == obj)
26 return true;
27 if (!super.equals(obj))
28 return false;
29 if (getClass() != obj.getClass())
30 return false;
31 GpxRoute other = (GpxRoute) obj;
32 if (routePoints == null) {
33 if (other.routePoints != null)
34 return false;
35 } else if (!routePoints.equals(other.routePoints))
36 return false;
37 return true;
38 }
39}
Note: See TracBrowser for help on using the repository browser.