@Test public void occurrences() { Definitions instance = new Definitions(); instance.addTag(1, "one", "", "", 0, 0); instance.addTag(1, "two", "", "", 0, 0); instance.addTag(3, "two", "", "", 0, 0); assertEquals(instance.occurrences("one"), 1); assertEquals(instance.occurrences("two"), 2); assertEquals(instance.occurrences("notFound"), 0); }
public int occurrences(String symbol) { Set<Integer> lines = symbols.get(symbol); return lines == null ? 0 : lines.size(); }
Definitions implements Serializable { public int occurrences(String symbol) { Set<Integer> lines = symbols.get(symbol); return lines == null ? 0 : lines.size(); } }
Definitions implements Serializable { public int occurrences(String symbol) { Set<Integer> lines = symbols.get(symbol); return lines == null ? 0 : lines.size(); } Definitions(); }
Definitions implements Serializable { public int occurrences(String symbol) { Set<Integer> lines = symbols.get(symbol); return lines == null ? 0 : lines.size(); } Definitions(); void resetUnused(); Set<String> getSymbols(); boolean hasSymbol(String symbol); boolean hasDefinitionAt(String symbol, int lineNumber, String[] strs); int occurrences(String symbol); int numberOfSymbols(); List<Tag> getTags(); List<Tag> getTags(int line); void addTag(int line, String symbol, String type, String text,
            int lineStart, int lineEnd); void addTag(int line, String symbol, String type, String text,
            String namespace, String signature, int lineStart, int lineEnd); byte[] serialize(); static Definitions deserialize(byte[] bytes); }
Definitions implements Serializable { public int occurrences(String symbol) { Set<Integer> lines = symbols.get(symbol); return lines == null ? 0 : lines.size(); } Definitions(); void resetUnused(); Set<String> getSymbols(); boolean hasSymbol(String symbol); boolean hasDefinitionAt(String symbol, int lineNumber, String[] strs); int occurrences(String symbol); int numberOfSymbols(); List<Tag> getTags(); List<Tag> getTags(int line); void addTag(int line, String symbol, String type, String text,
            int lineStart, int lineEnd); void addTag(int line, String symbol, String type, String text,
            String namespace, String signature, int lineStart, int lineEnd); byte[] serialize(); static Definitions deserialize(byte[] bytes);  }