Debian Codegraph @

src/uk/me/parabola/imgfmt/app/net/RoadIndex.java

raw symbols SCIP
1 /*
2 * Copyright (C) 2007 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: Jan 5, 2008
16 */
17 package uk.me.parabola.imgfmt.app.net;
18
19 import uk.me.parabola.imgfmt.app.ImgFileWriter;
20 import uk.me.parabola.imgfmt.app.trergn.Polyline;
21 import uk.me.parabola.imgfmt.app.trergn.Subdivision;
22
23
24 /**
25 * @author Steve Ratcliffe
26 */
27 public class RoadIndex {
28 private final Polyline linkedRoad;
29 // int Subdivision.getNumber()
30
31 public RoadIndex(Polyline road) {
32 linkedRoad = road;
33 }
34
35 private Subdivision getSubdiv() {
36 return linkedRoad.getSubdiv();
37 }
38
39 Polyline getLine() {
40 return linkedRoad;
41 }
42
43 void write(ImgFileWriter writer) {
44 int roadnum = linkedRoad.getNumber();
45 assert roadnum < 256;
46 writer.put1u(roadnum);
47 int subdivnum = getSubdiv().getNumber();
48 writer.put2u(subdivnum);
49 }
50 }