Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/LevelOrderIndices.java @ 795:cdade5005cba
Added javadoc in jfreechart package.
gnv-artifacts/trunk@877 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 31 Mar 2010 13:48:07 +0000 |
parents | c4156275c1e1 |
children | 22c18083225e |
comparison
equal
deleted
inserted
replaced
794:d0967fdee36f | 795:cdade5005cba |
---|---|
5 /** | 5 /** |
6 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> | 6 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> |
7 */ | 7 */ |
8 public class LevelOrderIndices | 8 public class LevelOrderIndices |
9 { | 9 { |
10 /** | |
11 * | |
12 */ | |
10 public interface Visitor { | 13 public interface Visitor { |
14 /** | |
15 * | |
16 * @param index | |
17 * @return | |
18 */ | |
11 Object visit(int index); | 19 Object visit(int index); |
12 } | 20 } |
13 | 21 |
22 /** | |
23 * | |
24 */ | |
14 protected int from; | 25 protected int from; |
26 /** | |
27 * | |
28 */ | |
15 protected int to; | 29 protected int to; |
16 | 30 |
31 /** | |
32 * | |
33 */ | |
17 public LevelOrderIndices() { | 34 public LevelOrderIndices() { |
18 } | 35 } |
19 | 36 |
37 /** | |
38 * | |
39 * @param to | |
40 */ | |
20 public LevelOrderIndices(int to) { | 41 public LevelOrderIndices(int to) { |
21 this(0, to); | 42 this(0, to); |
22 } | 43 } |
23 | 44 |
45 /** | |
46 * | |
47 * @param from | |
48 * @param to | |
49 */ | |
24 public LevelOrderIndices(int from, int to) { | 50 public LevelOrderIndices(int from, int to) { |
25 this.from = Math.min(from, to); | 51 this.from = Math.min(from, to); |
26 this.to = Math.max(from, to); | 52 this.to = Math.max(from, to); |
27 } | 53 } |
28 | 54 |
55 /** | |
56 * | |
57 * @param visitor | |
58 * @return | |
59 */ | |
29 public Object visit(Visitor visitor) { | 60 public Object visit(Visitor visitor) { |
30 LinkedList<int[]> queue = new LinkedList<int[]>(); | 61 LinkedList<int[]> queue = new LinkedList<int[]>(); |
31 | 62 |
32 queue.add(new int [] { from, to }); | 63 queue.add(new int [] { from, to }); |
33 | 64 |