• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.impl.StaticUnicodeSets;
7 import ohos.global.icu.impl.StringSegment;
8 import ohos.global.icu.text.UnicodeSet;
9 
10 /**
11  * @author sffc
12  * @hide exposed on OHOS
13  *
14  */
15 public class IgnorablesMatcher extends SymbolMatcher implements NumberParseMatcher.Flexible {
16 
17     private static final IgnorablesMatcher DEFAULT = new IgnorablesMatcher(
18             StaticUnicodeSets.get(StaticUnicodeSets.Key.DEFAULT_IGNORABLES));
19 
20     private static final IgnorablesMatcher STRICT = new IgnorablesMatcher(
21             StaticUnicodeSets.get(StaticUnicodeSets.Key.STRICT_IGNORABLES));
22 
23     private static final IgnorablesMatcher JAVA_COMPATIBILITY = new IgnorablesMatcher(
24             StaticUnicodeSets.get(StaticUnicodeSets.Key.EMPTY));
25 
getInstance(int parseFlags)26     public static IgnorablesMatcher getInstance(int parseFlags) {
27         if (0 != (parseFlags & ParsingUtils.PARSE_FLAG_JAVA_COMPATIBILITY_IGNORABLES)) {
28             return JAVA_COMPATIBILITY;
29         } else if (0 != (parseFlags & ParsingUtils.PARSE_FLAG_STRICT_IGNORABLES)) {
30             return STRICT;
31         } else {
32             return DEFAULT;
33         }
34     }
35 
IgnorablesMatcher(UnicodeSet ignorables)36     private IgnorablesMatcher(UnicodeSet ignorables) {
37         super("", ignorables);
38     }
39 
40     @Override
isDisabled(ParsedNumber result)41     protected boolean isDisabled(ParsedNumber result) {
42         return false;
43     }
44 
45     @Override
accept(StringSegment segment, ParsedNumber result)46     protected void accept(StringSegment segment, ParsedNumber result) {
47         // No-op
48     }
49 
50     @Override
toString()51     public String toString() {
52         return "<IgnorablesMatcher>";
53     }
54 }
55