comparison artifacts/src/main/java/org/dive4elements/river/artifacts/states/sq/SQPeriodSelect.java @ 8856:5e38e2924c07 3.2.x

Fix code style.
author Tom Gottfried <tom@intevation.de>
date Thu, 18 Jan 2018 20:12:01 +0100
parents 8dbb969091c5
children
comparison
equal deleted inserted replaced
8855:d7c005e12af0 8856:5e38e2924c07
38 protected Long getDataMinMaxDate(Artifact artifact, boolean minDate) { 38 protected Long getDataMinMaxDate(Artifact artifact, boolean minDate) {
39 D4EArtifact arti = (D4EArtifact) artifact; 39 D4EArtifact arti = (D4EArtifact) artifact;
40 RangeAccess access = new RangeAccess(arti); 40 RangeAccess access = new RangeAccess(arti);
41 double km = access.getLocations()[0]; 41 double km = access.getLocations()[0];
42 42
43 SQOverview overview = SQOverviewFactory.getOverview(access.getRiverName()); 43 SQOverview overview = SQOverviewFactory.getOverview(
44 access.getRiverName());
44 45
45 /* Filter is not implemented and only checks if a complete 46 /* Filter is not implemented and only checks if a complete
46 * KMIndex list is acceptable or not. So KMFiltering wont work */ 47 * KMIndex list is acceptable or not. So KMFiltering wont work */
47 KMIndex<List<Date>> entries = overview.filter(SQOverview.ACCEPT); 48 KMIndex<List<Date>> entries = overview.filter(SQOverview.ACCEPT);
48 TreeSet<Date> allDates = new TreeSet<Date>(); 49 TreeSet<Date> allDates = new TreeSet<Date>();
49 50
50 for (int i = 0; i < entries.size(); i++) { 51 for (int i = 0; i < entries.size(); i++) {
51 if (EpsilonComparator.CMP.compare(entries.get(i).getKm(), km) == 0) { 52 if (EpsilonComparator.CMP.compare(entries.get(i).getKm(), km)
53 == 0
54 ) {
52 allDates.addAll(entries.get(i).getValue()); 55 allDates.addAll(entries.get(i).getValue());
53 } 56 }
54 } 57 }
55 if (allDates.size() < 2) { 58 if (allDates.size() < 2) {
56 return null; 59 return null;
57 } 60 }
58 61
59 return minDate ? allDates.first().getTime() : allDates.last().getTime(); 62 return minDate
63 ? allDates.first().getTime()
64 : allDates.last().getTime();
60 } 65 }
61 66
62 @Override 67 @Override
63 protected Element[] createItems( 68 protected Element[] createItems(
64 XMLUtils.ElementCreator cr, 69 XMLUtils.ElementCreator cr,

http://dive4elements.wald.intevation.org