comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/SInfoResultType.java @ 9157:f9bb5d0a6ff3

Added the S-Info collision calculation and chart output
author mschaefer
date Tue, 19 Jun 2018 14:19:32 +0200
parents e6b63b2b41b9
children 1614cb14308f
comparison
equal deleted inserted replaced
9156:568961ff709a 9157:f9bb5d0a6ff3
61 61
62 @Override 62 @Override
63 public String exportValue(final CallContext context, final Object value) { 63 public String exportValue(final CallContext context, final Object value) {
64 final double doubleValue = asDouble(value); 64 final double doubleValue = asDouble(value);
65 return exportDoubleValue(context, doubleValue); // integer 65 return exportDoubleValue(context, doubleValue); // integer
66 // als 66 // als
67 // double? 67 // double?
68 // finde 68 // finde
69 // gerade 69 // gerade
70 // kein 70 // kein
71 // int-beispiel 71 // int-beispiel
72 } 72 }
73 73
74 @Override 74 @Override
75 protected NumberFormat createFormatter(final CallContext context) { 75 protected NumberFormat createFormatter(final CallContext context) {
76 return Formatter.getWaterlevelQ(context); 76 return Formatter.getWaterlevelQ(context);
83 83
84 @Override 84 @Override
85 public String exportValue(final CallContext context, final Object value) { 85 public String exportValue(final CallContext context, final Object value) {
86 final double doubleValue = asDouble(value); 86 final double doubleValue = asDouble(value);
87 return exportDoubleValue(context, doubleValue); // integer 87 return exportDoubleValue(context, doubleValue); // integer
88 // als 88 // als
89 // double? 89 // double?
90 // finde 90 // finde
91 // gerade 91 // gerade
92 // kein 92 // kein
93 // int-beispiel 93 // int-beispiel
94 } 94 }
95 95
96 @Override 96 @Override
97 protected NumberFormat createFormatter(final CallContext context) { 97 protected NumberFormat createFormatter(final CallContext context) {
98 return Formatter.getIntegerFormatter(context); 98 return Formatter.getIntegerFormatter(context);
600 protected NumberFormat createFormatter(final CallContext context) { 600 protected NumberFormat createFormatter(final CallContext context) {
601 return Formatter.getCollisionGaugeW(context); 601 return Formatter.getCollisionGaugeW(context);
602 } 602 }
603 }; 603 };
604 604
605 public static final SInfoResultType years = new SInfoResultType(I18NStrings.UNIT_NONE, SInfoI18NStrings.CSV_YEARS_HEADER) {
606 private static final long serialVersionUID = 1L;
607
608 @Override
609 public String exportValue(final CallContext context, final Object value) {
610 return exportStringValue(value);
611 }
612
613 @Override
614 protected NumberFormat createFormatter(final CallContext context) {
615 throw new UnsupportedOperationException();
616 }
617 };
618
619 public static final SInfoResultType dischargeZone = new SInfoResultType(I18NStrings.UNIT_NONE, SInfoI18NStrings.CSV_DISCHARGE_ZONE_HEADER) {
620 private static final long serialVersionUID = 1L;
621
622 @Override
623 public String exportValue(final CallContext context, final Object value) {
624 return exportStringValue(value);
625 }
626
627 @Override
628 protected NumberFormat createFormatter(final CallContext context) {
629 throw new UnsupportedOperationException();
630 }
631 };
605 } 632 }

http://dive4elements.wald.intevation.org