comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/FastCrossSectionChunk.java @ 6267:484a19628b1e

Added TODO about braindead code.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 11 Jun 2013 12:00:57 +0200
parents c297a61115d0
children 44ee7d26eb18
comparison
equal deleted inserted replaced
6266:c297a61115d0 6267:484a19628b1e
54 } 54 }
55 55
56 /** Finds the FastCrossSectionLine at km (null if not found). */ 56 /** Finds the FastCrossSectionLine at km (null if not found). */
57 public FastCrossSectionLine getCrossSectionLine(double km) { 57 public FastCrossSectionLine getCrossSectionLine(double km) {
58 FastCrossSectionLine key = new FastCrossSectionLine(km); 58 FastCrossSectionLine key = new FastCrossSectionLine(km);
59 // TODO follwing is braindead. Create the list in sorted fashion
60 // instead and remove sorting here.
59 Collections.sort(crossSectionLines, FastCrossSectionLine.KM_CMP); 61 Collections.sort(crossSectionLines, FastCrossSectionLine.KM_CMP);
60 int pos = Collections.binarySearch( 62 int pos = Collections.binarySearch(
61 crossSectionLines, key, FastCrossSectionLine.KM_CMP); 63 crossSectionLines, key, FastCrossSectionLine.KM_CMP);
62 return pos < 0 ? null : crossSectionLines.get(pos); 64 return pos < 0 ? null : crossSectionLines.get(pos);
63 } 65 }

http://dive4elements.wald.intevation.org