@Test public void testCountOccurrencesOf() { System.out.println("countOccurrencesOf"); assertEquals(3, Numek.countOccurrencesOf("aaa", 'a')); assertEquals(0, Numek.countOccurrencesOf("aaa", 'b')); assertEquals(2, Numek.countOccurrencesOf("aba", 'a')); }
public static int countOccurrencesOf(String source, char pattern) { int count = 0; if (source != null) { int found = -1; int start = 0; while ((found = source.indexOf(pattern, start)) != -1) { start = found + 1; count++; } return count; } else { return 0; } }
Numek { public static int countOccurrencesOf(String source, char pattern) { int count = 0; if (source != null) { int found = -1; int start = 0; while ((found = source.indexOf(pattern, start)) != -1) { start = found + 1; count++; } return count; } else { return 0; } } }
Numek { public static int countOccurrencesOf(String source, char pattern) { int count = 0; if (source != null) { int found = -1; int start = 0; while ((found = source.indexOf(pattern, start)) != -1) { start = found + 1; count++; } return count; } else { return 0; } } Numek();  Numek(Locale l);  Numek(Locale l, String resources_dir); }
Numek { public static int countOccurrencesOf(String source, char pattern) { int count = 0; if (source != null) { int found = -1; int start = 0; while ((found = source.indexOf(pattern, start)) != -1) { start = found + 1; count++; } return count; } else { return 0; } } Numek();  Numek(Locale l);  Numek(Locale l, String resources_dir); static Double calc_and_sum_frac(String snumber); String text2number(String snumber); final String disambiguate(String pattern); String getNormTextandPattern(String text, String pattern); static int countOccurrencesOf(String source, char pattern); static String Roman2Decimal(String roman); }
Numek { public static int countOccurrencesOf(String source, char pattern) { int count = 0; if (source != null) { int found = -1; int start = 0; while ((found = source.indexOf(pattern, start)) != -1) { start = found + 1; count++; } return count; } else { return 0; } } Numek();  Numek(Locale l);  Numek(Locale l, String resources_dir); static Double calc_and_sum_frac(String snumber); String text2number(String snumber); final String disambiguate(String pattern); String getNormTextandPattern(String text, String pattern); static int countOccurrencesOf(String source, char pattern); static String Roman2Decimal(String roman); public Locale locale; public HashSet<String> all_keys; public HashSet<String> repeated_keys; public PhraselistFile ambiguous; public PhraselistFile delimiters; public PhraselistFile units; public PhraselistFile tens; public PhraselistFile irregular_tens; public PhraselistFile magnitudes; public PhraselistFile special_groups; public PhraselistFile restrictions; public PhraselistFile ordinal_units; public PhraselistFile ordinal_irregular_tens; public PhraselistFile ordinal_tens; public PhraselistFile ordinal_suffixes; public PhraselistFile decimal_point_separator; public PhraselistFile group_separators; final static Integer MAX_NUMBERS_ORDER; static String romans; static String romans5; final static HashMap<String, Integer> romansMap; }