1 /* GENERATED SOURCE. DO NOT MODIFY. */ 2 // © 2017 and later: Unicode, Inc. and others. 3 // License & terms of use: http://www.unicode.org/copyright.html#License 4 package ohos.global.icu.impl.number.parse; 5 6 import ohos.global.icu.number.Scale; 7 8 /** 9 * Wraps a {@link Scale} for use in the number parsing pipeline. 10 * @hide exposed on OHOS 11 */ 12 public class MultiplierParseHandler extends ValidationMatcher { 13 14 private final Scale multiplier; 15 MultiplierParseHandler(Scale multiplier)16 public MultiplierParseHandler(Scale multiplier) { 17 this.multiplier = multiplier; 18 } 19 20 @Override postProcess(ParsedNumber result)21 public void postProcess(ParsedNumber result) { 22 if (result.quantity != null) { 23 multiplier.applyReciprocalTo(result.quantity); 24 // NOTE: It is okay if the multiplier was negative. 25 } 26 } 27 28 @Override toString()29 public String toString() { 30 return "<MultiplierHandler " + multiplier + ">"; 31 } 32 } 33