Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/common/AbstractResultType.java @ 9157:f9bb5d0a6ff3
Added the S-Info collision calculation and chart output
author | mschaefer |
---|---|
date | Tue, 19 Jun 2018 14:19:32 +0200 |
parents | 23945061daec |
children | d2472018740c |
comparison
equal
deleted
inserted
replaced
9156:568961ff709a | 9157:f9bb5d0a6ff3 |
---|---|
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the | 7 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
8 * documentation coming with Dive4Elements River for details. | 8 * documentation coming with Dive4Elements River for details. |
9 */ | 9 */ |
10 package org.dive4elements.river.artifacts.common; | 10 package org.dive4elements.river.artifacts.common; |
11 | 11 |
12 import java.text.DateFormat; | |
12 import java.text.NumberFormat; | 13 import java.text.NumberFormat; |
14 import java.util.Date; | |
13 import java.util.HashMap; | 15 import java.util.HashMap; |
14 import java.util.Locale; | 16 import java.util.Locale; |
15 import java.util.Map; | 17 import java.util.Map; |
16 | 18 |
17 import org.apache.commons.lang.StringUtils; | 19 import org.apache.commons.lang.StringUtils; |
82 this.formatters.put(locale, createFormatter(context)); | 84 this.formatters.put(locale, createFormatter(context)); |
83 | 85 |
84 return this.formatters.get(locale); | 86 return this.formatters.get(locale); |
85 } | 87 } |
86 | 88 |
89 protected final String exportDateValue(final CallContext context, final Date value) { | |
90 final Locale locale = Resources.getLocale(context.getMeta()); | |
91 final DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, locale); | |
92 return df.format(value); | |
93 } | |
94 | |
87 protected abstract NumberFormat createFormatter(CallContext context); | 95 protected abstract NumberFormat createFormatter(CallContext context); |
88 | 96 |
89 @Override | 97 @Override |
90 public final String getCsvHeader() { | 98 public final String getCsvHeader() { |
91 return this.csvHeader; | 99 return this.csvHeader; |
93 | 101 |
94 public final String getCsvHeader(final CallMeta meta) { | 102 public final String getCsvHeader(final CallMeta meta) { |
95 return Resources.getMsg(meta, this.csvHeader, this.csvHeader); | 103 return Resources.getMsg(meta, this.csvHeader, this.csvHeader); |
96 } | 104 } |
97 | 105 |
106 @Override | |
98 public final String getPdfHeader(final CallMeta meta) { | 107 public final String getPdfHeader(final CallMeta meta) { |
99 return Resources.getMsg(meta, this.pdfHeader, this.pdfHeader); | 108 return Resources.getMsg(meta, this.pdfHeader, this.pdfHeader); |
100 } | 109 } |
101 | 110 |
111 @Override | |
102 public final String getUnit() { | 112 public final String getUnit() { |
103 return this.unit; | 113 return this.unit; |
104 } | 114 } |
105 } | 115 } |