Debian Codegraph @

src/uk/me/parabola/imgfmt/app/CoordNode.java

raw symbols SCIP
1 /*
2 * Copyright (C) 2008 Steve Ratcliffe
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 *
14 * Author: Steve Ratcliffe
15 * Create date: 13-Jul-2008
16 */
17 package uk.me.parabola.imgfmt.app;
18
19 /**
20 * A coordinate that is known to be a routing node. You can tell by the fact
21 * that getId() returns != 0.
22 *
23 * @author Steve Ratcliffe
24 */
25 public class CoordNode extends Coord {
26 private final int id;
27
28 /**
29 * Construct from co-ordinates that are already in map-units.
30 *
31 * @param latitude The latitude in map units.
32 * @param longitude The longitude in map units.
33 * @param id The ID of this routing node.
34 * @param boundary This is a routing node on the boundary.
35 * @param onCountryBorder This is a routing node on a country boundary.
36 */
37 public CoordNode(int latitude, int longitude, int id, boolean boundary, boolean onCountryBorder) {
38 super(latitude, longitude);
39 this.id = id;
40 setOnBoundary(boundary);
41 setOnCountryBorder(onCountryBorder);
42 setNumberNode(true);
43 }
44
45 public CoordNode(Coord other, int id, boolean boundary, boolean onCountryBorder) {
46 super(other);
47 this.id = id;
48 setOnBoundary(boundary);
49 setOnCountryBorder(onCountryBorder);
50 setNumberNode(true);
51 }
52
53 @Override
54 public int getId() {
55 return id;
56 }
57 }