2121public abstract class CharacteristicInput <A extends Quantity <A >, O extends Quantity <O >>
2222 implements Serializable {
2323 protected final String characteristicPrefix ;
24- protected final int decimalPlaces ;
2524
2625 private final SortedSet <CharacteristicPoint <A , O >> points ;
2726
@@ -30,24 +29,17 @@ public abstract class CharacteristicInput<A extends Quantity<A>, O extends Quant
3029 *
3130 * @param points Set of points that describe the characteristic
3231 * @param characteristicPrefix Prefix, that prepends the actual characteristic
33- * @param decimalPlaces Desired amount of decimal places when de-serializing the characteristic
3432 */
3533 protected CharacteristicInput (
36- SortedSet <CharacteristicPoint <A , O >> points , String characteristicPrefix , int decimalPlaces ) {
34+ SortedSet <CharacteristicPoint <A , O >> points , String characteristicPrefix ) {
3735 this .points = Collections .unmodifiableSortedSet (points );
3836 this .characteristicPrefix = characteristicPrefix ;
39- this .decimalPlaces = decimalPlaces ;
4037 }
4138
4239 protected CharacteristicInput (
43- String input ,
44- Unit <A > abscissaUnit ,
45- Unit <O > ordinateUnit ,
46- String characteristicPrefix ,
47- int decimalPlaces )
40+ String input , Unit <A > abscissaUnit , Unit <O > ordinateUnit , String characteristicPrefix )
4841 throws ParsingException {
4942 this .characteristicPrefix = characteristicPrefix ;
50- this .decimalPlaces = decimalPlaces ;
5143
5244 if (!input .startsWith (characteristicPrefix + ":{" ) || !input .endsWith ("}" ))
5345 throw new ParsingException (
@@ -114,31 +106,28 @@ public SortedSet<CharacteristicPoint<A, O>> getPoints() {
114106 }
115107
116108 /**
117- * De-serialize the characteristic to a commonly understood string
109+ * Serialize the characteristic to a commonly understood string
118110 *
119- * @return the characteristic as de- serialized string
111+ * @return the characteristic as serialized string
120112 */
121- public String deSerialize () {
113+ public String serialize () {
122114 return characteristicPrefix
123115 + ":{"
124- + points .stream ()
125- .map (point -> point .deSerialize (decimalPlaces ))
126- .collect (Collectors .joining ("," ))
116+ + points .stream ().map (CharacteristicPoint ::serialize ).collect (Collectors .joining ("," ))
127117 + "}" ;
128118 }
129119
130120 @ Override
131121 public boolean equals (Object o ) {
132122 if (this == o ) return true ;
133123 if (!(o instanceof CharacteristicInput <?, ?> that )) return false ;
134- return decimalPlaces == that .decimalPlaces
135- && characteristicPrefix .equals (that .characteristicPrefix )
136- && points .equals (that .points );
124+
125+ return characteristicPrefix .equals (that .characteristicPrefix ) && points .equals (that .points );
137126 }
138127
139128 @ Override
140129 public int hashCode () {
141- return Objects .hash (characteristicPrefix , decimalPlaces , points );
130+ return Objects .hash (characteristicPrefix , points );
142131 }
143132
144133 @ Override
0 commit comments