source: josm/branch/0.5/src/org/openstreetmap/josm/data/osm/WaySegment.java@ 330

Last change on this file since 330 was 330, checked in by framm, 17 years ago

forgot to add some files...

File size: 703 bytes
Line 
1// License: GPL. Copyright 2007 by Gabriel Ebner
2package org.openstreetmap.josm.data.osm;
3
4/**
5 * A segment consisting of 2 consecutive nodes out of a way.
6 */
7public final class WaySegment {
8 /**
9 * The way.
10 */
11 public Way way;
12
13 /**
14 * The index of one of the 2 nodes in the way. The other node has the
15 * index <code>lowerIndex + 1</code>.
16 */
17 public int lowerIndex;
18
19 public WaySegment(Way w, int i) {
20 way = w;
21 lowerIndex = i;
22 }
23
24 @Override public boolean equals(Object o) {
25 return o != null && o instanceof WaySegment
26 && ((WaySegment) o).way == way
27 && ((WaySegment) o).lowerIndex == lowerIndex;
28 }
29
30 @Override public int hashCode() {
31 return way.hashCode() ^ lowerIndex;
32 }
33}
Note: See TracBrowser for help on using the repository browser.