Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/states/sq/OutlierMethod.java @ 9277:2323d005f9a5
compile error fix
author | gernotbelger |
---|---|
date | Fri, 20 Jul 2018 10:39:02 +0200 |
parents | e4606eae8ea5 |
children |
comparison
equal
deleted
inserted
replaced
9276:3141f0e7314e | 9277:2323d005f9a5 |
---|---|
7 */ | 7 */ |
8 | 8 |
9 package org.dive4elements.river.artifacts.states.sq; | 9 package org.dive4elements.river.artifacts.states.sq; |
10 | 10 |
11 import org.apache.log4j.Logger; | 11 import org.apache.log4j.Logger; |
12 import org.w3c.dom.Element; | |
13 | |
14 import org.dive4elements.artifactdatabase.ProtocolUtils; | |
15 import org.dive4elements.artifacts.Artifact; | 12 import org.dive4elements.artifacts.Artifact; |
16 import org.dive4elements.artifacts.CallContext; | 13 import org.dive4elements.artifacts.CallContext; |
17 import org.dive4elements.artifacts.CallMeta; | 14 import org.dive4elements.artifacts.CallMeta; |
18 import org.dive4elements.artifacts.common.utils.XMLUtils; | 15 import org.dive4elements.artifacts.common.utils.XMLUtils; |
19 import org.dive4elements.river.artifacts.resources.Resources; | 16 import org.dive4elements.river.artifacts.resources.Resources; |
20 import org.dive4elements.river.artifacts.states.DefaultState; | 17 import org.dive4elements.river.artifacts.states.DefaultState; |
18 import org.w3c.dom.Element; | |
21 | 19 |
22 | 20 public class OutlierMethod extends DefaultState { |
23 public class OutlierMethod | 21 /** The log that is used in this class. */ |
24 extends DefaultState | |
25 { | |
26 /** The log that is used in this class.*/ | |
27 private static Logger log = Logger.getLogger(OutlierMethod.class); | 22 private static Logger log = Logger.getLogger(OutlierMethod.class); |
28 | 23 |
29 public static final String STD_DEV = "outlier.method.std-dev"; | 24 public static final String STD_DEV = "outlier.method.std-dev"; |
30 public static final String GRUBBS = "outlier.method.grubbs"; | 25 public static final String GRUBBS = "outlier.method.grubbs"; |
31 | 26 |
32 public static final String[] METHODS = { | 27 public static final String[] METHODS = { STD_DEV, GRUBBS, }; |
33 STD_DEV, | |
34 GRUBBS, | |
35 }; | |
36 | |
37 | 28 |
38 @Override | 29 @Override |
39 protected String getUIProvider() { | 30 protected String getUIProvider() { |
40 return ""; | 31 return ""; |
41 } | 32 } |
42 | 33 |
43 @Override | 34 @Override |
44 protected Element[] createItems( | 35 protected Element[] createItems(final XMLUtils.ElementCreator cr, final Artifact artifact, final String name, final CallContext context) { |
45 XMLUtils.ElementCreator cr, | 36 final CallMeta meta = context.getMeta(); |
46 Artifact artifact, | |
47 String name, | |
48 CallContext context) | |
49 { | |
50 CallMeta meta = context.getMeta(); | |
51 | 37 |
52 Element[] methods = new Element[METHODS.length]; | 38 final Element[] methods = new Element[METHODS.length]; |
53 | 39 |
54 int i = 0; | 40 int i = 0; |
55 | 41 |
56 for (String method: METHODS) { | 42 for (final String method : METHODS) { |
57 methods[i++] = createItem( | 43 methods[i++] = createItem(cr, new String[] { Resources.getMsg(meta, method, method), method }); |
58 cr, new String[] { | |
59 Resources.getMsg(meta, method, method), | |
60 method | |
61 }); | |
62 } | 44 } |
63 | 45 |
64 return methods; | 46 return methods; |
65 } | 47 } |
66 | 48 |
67 | 49 // ist mit super identisch! |
68 @Override | 50 // @Override |
69 protected Element createItem(XMLUtils.ElementCreator cr, Object obj) { | 51 // protected Element createItem(final XMLUtils.ElementCreator cr, final Object obj) { |
70 Element item = ProtocolUtils.createArtNode(cr, "item", null, null); | 52 // final Element item = ProtocolUtils.createArtNode(cr, "item", null, null); |
71 Element label = ProtocolUtils.createArtNode(cr, "label", null, null); | 53 // final Element label = ProtocolUtils.createArtNode(cr, "label", null, null); |
72 Element value = ProtocolUtils.createArtNode(cr, "value", null, null); | 54 // final Element value = ProtocolUtils.createArtNode(cr, "value", null, null); |
73 | 55 // |
74 String[] arr = (String[]) obj; | 56 // final String[] arr = (String[]) obj; |
75 | 57 // |
76 label.setTextContent(arr[0]); | 58 // label.setTextContent(arr[0]); |
77 value.setTextContent(arr[1]); | 59 // value.setTextContent(arr[1]); |
78 | 60 // |
79 item.appendChild(label); | 61 // item.appendChild(label); |
80 item.appendChild(value); | 62 // item.appendChild(value); |
81 | 63 // |
82 return item; | 64 // return item; |
83 } | 65 // } |
84 } | 66 } |