01 package dk.deepthought.sidious.explanation;
02
03 import net.jcip.annotations.Immutable;
04
05 /**
06 * Helper class for representing a key-value pair.
07 *
08 * @author Deepthought
09 *
10 */
11 @Immutable
12 public class ExplanationEntry {
13
14 /**
15 * The ruleName.
16 */
17 private final String ruleName;
18
19 /**
20 * The value.
21 */
22 private final double value;
23
24 /**
25 * Creates an entry set.
26 *
27 * @param ruleName
28 * the ruleName
29 * @param value
30 * the value
31 */
32 public ExplanationEntry(final String ruleName, final double value) {
33 this.ruleName = ruleName;
34 this.value = value;
35 }
36
37 /**
38 * Gets the ruleName.
39 *
40 * @return the ruleName
41 */
42 public String getRuleName() {
43 return ruleName;
44 }
45
46 /**
47 * Gets the value.
48 *
49 * @return the value
50 */
51 public double getValue() {
52 return value;
53 }
54
55 /*
56 * (non-Javadoc)
57 *
58 * @see java.lang.Object#toString()
59 */
60 @Override
61 public String toString() {
62 return getClass().getSimpleName() + "[ruleName=" + ruleName
63 + ", value=" + value + "]";
64 }
65
66
67 }
|