Home
last modified time | relevance | path

Searched refs:RangeSpecification (Results 1 – 25 of 27) sorted by relevance

12

/third_party/libphonenumber/metadata/src/test/java/com/google/i18n/phonenumbers/metadata/
DRangeSpecificationTest.java21 import static com.google.i18n.phonenumbers.metadata.RangeSpecification.ALL_DIGITS_MASK;
22 import static com.google.i18n.phonenumbers.metadata.RangeSpecification.parse;
41 assertThat(parse("")).isSameInstanceAs(RangeSpecification.empty()); in testParse()
75 assertThat(RangeSpecification.singleton(asList(0, 1, 2, 4, 5, 7, 8, 9))) in testSingleton()
81 assertThat(RangeSpecification.empty().matches(DigitSequence.empty())).isTrue(); in testMatches()
106 assertThat(RangeSpecification.empty().getSequenceCount()).isEqualTo(1); in testSequenceCount()
114 assertThat(RangeSpecification.from(DigitSequence.empty())) in testFrom()
115 .isEqualTo(RangeSpecification.empty()); in testFrom()
116 assertThat(RangeSpecification.from(DigitSequence.of("1"))).isEqualTo(parse("1")); in testFrom()
117 assertThat(RangeSpecification.from(DigitSequence.of("1234"))).isEqualTo(parse("1234")); in testFrom()
[all …]
DRangeTreeTest.java57 RangeTree r = RangeTree.from(RangeSpecification.empty()); in testEmptySequenceTree()
58 assertThat(r).containsExactly(RangeSpecification.empty()); in testEmptySequenceTree()
107 assertThat(RangeTree.from(RangeSpecification.empty())).contains(""); in testContains()
119 assertThat(RangeTree.from(RangeSpecification.empty())).hasSize(1); in testMatchCount()
225 List<RangeSpecification> specs = specs( in testComplexSpecsToSimpleRange()
284 assertThat(RangeTree.from(RangeSpecification.empty()).first()).isEqualTo(DigitSequence.empty()); in testMin()
297 assertThat(RangeTree.from(RangeSpecification.empty()).sample(0)) in testSample()
325 assertThat(ranges.prefixWith(RangeSpecification.empty())).isSameInstanceAs(ranges); in testPrefixWith()
343 List<RangeSpecification> expected = specs( in testSerializingRealWorldExample()
535 private static RangeSpecification spec(String s) { in spec()
[all …]
DPrefixTreeTest.java61 assertThat(zeroLength).containsExactly(RangeSpecification.empty()); in testEmptyVsZeroLength()
109 PrefixTree prefix = PrefixTree.from(RangeTree.from(RangeSpecification.empty())); in testZeroLengthPrefix()
144 assertThat(prefixes("1234").trim(0)).containsExactly(RangeSpecification.empty()); in testTrim()
211 return RangeTree.from(Arrays.stream(specs).map(RangeSpecification::parse)); in ranges()
DRangeTreeFactorizerTest.java98 List<RangeSpecification> specs(String... s) { in specs()
99 return Stream.of(s).map(RangeSpecification::parse).collect(toImmutableList()); in specs()
/third_party/libphonenumber/metadata/src/main/java/com/google/i18n/phonenumbers/metadata/
DRangeSpecification.java53 public final class RangeSpecification implements Comparable<RangeSpecification> { class
57 private static final RangeSpecification EMPTY = new RangeSpecification("");
60 public static RangeSpecification empty() { in empty()
65 public static RangeSpecification singleton(Iterable<Integer> digits) { in singleton()
71 return new RangeSpecification(String.valueOf((char) mask)); in singleton()
75 public static RangeSpecification from(DigitSequence s) { in from()
77 return RangeSpecification.empty(); in from()
83 return new RangeSpecification(new String(masks)); in from()
87 public static RangeSpecification any(int length) { in any()
90 return RangeSpecification.empty(); in any()
[all …]
DPrefixTree.java62 public static PrefixTree from(RangeSpecification spec) { in from()
105 minimal = emit(root, RangeSpecification.empty(), RangeTree.empty(), minLength); in minimal()
108 root, RangeSpecification.empty(), exclude.getInitial(), RangeTree.empty(), minLength); in minimal()
246 return RangeTree.from(RangeSpecification.empty()); in trim()
253 private final List<RangeSpecification> paths = new ArrayList<>();
254 private RangeSpecification path = RangeSpecification.empty();
258 RangeSpecification oldPath = path; in visit()
290 return ranges.map(RangeSpecification::getPrefix); in removeTrailingAnyDigitPaths()
301 DfaNode node, RangeSpecification path, DfaNode exclude, RangeTree minimal, int minLength) { in recursivelyMinimize()
340 DfaNode node, RangeSpecification path, RangeTree minimal, int minLength) { in emit()
DRangeTreeFactorizer.java74 factors.add(ranges.intersect(RangeTree.from(RangeSpecification.any(n)))); in factor()
110 recursivelyMerge(ranges.getInitial(), factor.getInitial(), RangeSpecification.empty()); in mergeFrom()
114 void recursivelyMerge(DfaNode srcNode, DfaNode dstNode, RangeSpecification path) { in recursivelyMerge()
123 private final RangeSpecification path;
138 FactoringVisitor(DfaNode dstNode, RangeSpecification path) { in FactoringVisitor()
174 private final RangeSpecification path;
176 MergingVisitor(RangeSpecification path) { in MergingVisitor()
181 RangeSpecification newPath = path.extendByMask(mask); in recurse()
DRangeTree.java22 import static com.google.i18n.phonenumbers.metadata.RangeSpecification.ALL_DIGITS_MASK;
300 checkArgument(mask > 0 && mask <= RangeSpecification.ALL_DIGITS_MASK); in Edge()
342 return RangeSpecification.toString(mask); in toString()
657 mask &= RangeSpecification.ALL_DIGITS_MASK; in recurse()
829 public static RangeTree from(RangeSpecification s) { in from()
841 public static RangeTree from(Iterable<RangeSpecification> specs) { in from()
844 for (RangeSpecification s : specs) { in from()
855 public static RangeTree from(Stream<RangeSpecification> specs) { in from()
865 return !ranges.isEmpty() ? from(RangeSpecification.from(ranges)) : RangeTree.empty(); in from()
1156 public RangeTree map(Function<RangeSpecification, RangeSpecification> fn) { in map() argument
[all …]
/third_party/libphonenumber/metadata/src/main/java/com/google/i18n/phonenumbers/metadata/table/
DRangeKey.java22 import static com.google.i18n.phonenumbers.metadata.RangeSpecification.ALL_DIGITS_MASK;
30 import com.google.i18n.phonenumbers.metadata.RangeSpecification;
63 public static RangeKey create(RangeSpecification prefix, Set<Integer> lengths) { in create()
114 keys.add(new AutoValue_RangeKey(RangeSpecification.empty(), buildLengths(lengthMask))); in visit()
121 private RangeSpecification path = RangeSpecification.empty();
134 RangeSpecification oldPath = path; in visit()
169 public abstract RangeSpecification getPrefix(); in getPrefix()
181 public final ImmutableList<RangeSpecification> asRangeSpecifications() { in asRangeSpecifications()
182 RangeSpecification s = getPrefix(); in asRangeSpecifications()
189 RangeSpecification s = getPrefix(); in asRangeTree()
DRangeTable.java41 import com.google.i18n.phonenumbers.metadata.RangeSpecification;
381 Schema schema, Table<RangeSpecification, Column<?>, Optional<?>> t) { in from() argument
383 for (Entry<RangeSpecification, Map<Column<?>, Optional<?>>> row : t.rowMap().entrySet()) { in from()
572 public ImmutableTable<RangeSpecification, Column<?>, Optional<?>> toImmutableTable() { in toImmutableTable()
585 TreeBasedTable<RangeSpecification, Column<?>, Optional<?>> out = in toImmutableTable()
586 TreeBasedTable.create(comparing(RangeSpecification::min), schema.ordering()); in toImmutableTable()
588 List<RangeSpecification> keys = c.getRanges().asRangeSpecifications(); in toImmutableTable()
590 for (RangeSpecification k : keys) { in toImmutableTable()
827 ImmutableTable<RangeSpecification, Column<?>, Optional<?>> table = toImmutableTable(); in toString()
/third_party/libphonenumber/metadata/src/test/java/com/google/i18n/phonenumbers/metadata/model/
DAltFormatSpecTest.java22 import com.google.i18n.phonenumbers.metadata.RangeSpecification;
34 RangeSpecification prefix = RangeSpecification.parse("123"); in testSimple()
72 RangeSpecification p = RangeSpecification.parse(prefix); in assertGoodTemplateAndPrefix()
78 RangeSpecification p = RangeSpecification.parse(prefix); in assertBadTemplateAndPrefix()
/third_party/libphonenumber/metadata/src/test/java/com/google/i18n/phonenumbers/metadata/table/
DRangeKeyTest.java24 import com.google.i18n.phonenumbers.metadata.RangeSpecification;
41 ImmutableList<RangeKey> keys = RangeKey.decompose(RangeTree.from(RangeSpecification.empty())); in testZeroLengthMatch()
116 RangeSpecification prefix = in key()
117 spec.isEmpty() ? RangeSpecification.empty() : RangeSpecification.parse(spec); in key()
122 return RangeTree.from(Stream.of(spec).map(RangeSpecification::parse)); in ranges()
125 private static RangeSpecification spec(String spec) { in spec()
126 return RangeSpecification.parse(spec); in spec()
DChangeTest.java23 import com.google.i18n.phonenumbers.metadata.RangeSpecification;
69 return RangeTree.from(Arrays.stream(rangeSpecs).map(RangeSpecification::parse)); in ranges()
DRangeTableTest.java36 import com.google.i18n.phonenumbers.metadata.RangeSpecification;
70 .mapToObj(RangeSpecification::any));
201 Table<RangeSpecification, Column<?>, Optional<?>> exported = original.toImmutableTable(); in testTableImportExport()
389 return RangeTree.from(Arrays.stream(rangeSpecs).map(RangeSpecification::parse)); in ranges()
408 private static Cell<RangeSpecification, Column<?>, Optional<?>> assigned( in assigned()
410 return Tables.immutableCell(RangeSpecification.parse(range), column, Optional.of(value)); in assigned()
DCsvTableTest.java44 import com.google.i18n.phonenumbers.metadata.RangeSpecification;
273 RangeSpecification prefix = in key()
274 spec.isEmpty() ? RangeSpecification.empty() : RangeSpecification.parse(spec); in key()
/third_party/libphonenumber/migrator/src/test/java/com/google/phonenumbers/migrator/
DMigrationUtilsTest.java23 import com.google.i18n.phonenumbers.metadata.RangeSpecification;
77 RangeSpecification testRangeSpec = RangeSpecification.from(DigitSequence.of(VALID_TEST_NUMBER)); in getMigratableNumbers_invalidKey_expectException()
94 RangeSpecification testRangeSpec = RangeSpecification.from(DigitSequence.of("12")); in getMigratableNumbers_validKey_expectNoExceptionAndNoMatches()
127 RangeSpecification oldFormat = RangeSpecification in findMatchingRecipe_expectMatchingRecipe()
DMigrationJobTest.java21 import com.google.i18n.phonenumbers.metadata.RangeSpecification;
80 RangeSpecification testRecipePrefix = RangeSpecification.from(DigitSequence.of("123")); in customRecipes_singleMigration_unsupportedRecipeKey_expectException()
100 RangeSpecification testRecipePrefix = RangeSpecification.from(DigitSequence.of("12")); in customRecipes_singleMigration_validKey_expectMigration()
114 RangeSpecification testRecipePrefix = RangeSpecification.from(DigitSequence.of("13")); in customRecipes_invalidOldFormatValue_expectException()
134 RangeSpecification testRecipePrefix = RangeSpecification.from(DigitSequence.of("10")); in customRecipe_multipleMigration_nextRecipeNotFound_expectException()
156 RangeSpecification testRecipePrefix = RangeSpecification.from(DigitSequence.of("15")); in customRecipe_multipleMigration_expectMigration()
/third_party/libphonenumber/metadata/src/main/java/com/google/i18n/phonenumbers/metadata/model/
DAltFormatSpec.java24 import com.google.i18n.phonenumbers.metadata.RangeSpecification;
44 FormatTemplate template, RangeSpecification prefix, String parent, Optional<String> comment) { in create()
68 public abstract RangeSpecification prefix(); in prefix()
79 RangeSpecification prefix = prefix(); in specifier()
86 ? Ascii.toUpperCase(RangeSpecification.toString(prefix.getBitmask(digitIdx))) in specifier()
DAltFormatsSchema.java26 import com.google.i18n.phonenumbers.metadata.RangeSpecification;
119 RangeSpecification prefix = RangeSpecification.parse( in parseAltFormat()
DNumberingScheme.java45 import com.google.i18n.phonenumbers.metadata.RangeSpecification;
351 .map(RangeSpecification::from) in checkUnambiguousIdd()
439 bad = bad.union(assigned.intersect(RangeTree.from(RangeSpecification.any(n)))); in checkFormatLengths()
493 RangeTree lengthMask = RangeTree.from(altLengths.stream().map(RangeSpecification::any)); in checkAltFormatConsistency()
518 RangeSpecification minSpec = RangeSpecification.empty(); in checkAltFormatConsistency()
/third_party/libphonenumber/metadata/src/test/java/com/google/i18n/phonenumbers/metadata/testing/
DRangeTreeSubject.java28 import com.google.i18n.phonenumbers.metadata.RangeSpecification;
91 public void containsExactly(RangeSpecification spec) { in containsExactly()
98 public void containsExactly(Iterable<RangeSpecification> specs) { in containsExactly()
106 containsExactly(RangeSpecification.parse(spec)); in containsExactly()
110 containsExactly(FluentIterable.from(specs).transform(RangeSpecification::parse)); in containsExactly()
DRangeTableSubject.java27 import com.google.i18n.phonenumbers.metadata.RangeSpecification;
78 ImmutableTable<RangeSpecification, Column<?>, Optional<?>> table = in hasRanges()
80 RangeSpecification rowKey = RangeSpecification.parse(spec); in hasRanges()
DTestNumberingScheme.java33 import com.google.i18n.phonenumbers.metadata.RangeSpecification;
165 this.carrierPrefixes = RangeTree.from(Arrays.stream(prefix).map(RangeSpecification::parse)); in setCarrierPrefixes()
266 internationalPrefix.map(p -> RangeTree.from(RangeSpecification.from(p))) in build()
464 RangeTree ranges = RangeTree.from(Arrays.stream(specs).map(RangeSpecification::parse)); in rangesOf()
/third_party/libphonenumber/migrator/src/main/java/com/google/phonenumbers/migrator/
DRecipesTableSchema.java20 import com.google.i18n.phonenumbers.metadata.RangeSpecification;
102 return RangeKey.create(RangeSpecification.parse(parts.get(0)), rangeKeyLength); in read()
DMigrationJob.java20 import com.google.i18n.phonenumbers.metadata.RangeSpecification;
163 Preconditions.checkArgument(RangeSpecification.parse(oldFormat).matches(migratingNumber), in migrate()

12