@Test public void hasDefinitionAt() { Definitions instance = new Definitions(); String[] type= new String[1]; type[0]=""; instance.addTag(1, "found", "", "", 0, 0); assertEquals(instance.hasDefinitionAt("found", 0, type), false); assertEquals(instance.hasDefinitionAt("found", 1, type), true); assertEquals(instance.hasDefinitionAt("found", 2, type), false); assertEquals(instance.hasDefinitionAt("notFound", 0, type), false); assertEquals(instance.hasDefinitionAt("notFound", 1, type), false); }
public boolean hasDefinitionAt(String symbol, int lineNumber, String[] strs) { Set<Integer> lines = symbols.get(symbol); if (strs.length > 0) { strs[0] = "none"; } if (lines != null && lines.contains(lineNumber)) { LineTagMap line_map = line_maps.get(lineNumber); if (line_map != null) { for (Tag tag : line_map.sym_tags.get(symbol)) { if (tag.used) { continue; } if (strs.length > 0) { strs[0] = tag.type; } tag.used = true; return true; } } } return false; }
Definitions implements Serializable { public boolean hasDefinitionAt(String symbol, int lineNumber, String[] strs) { Set<Integer> lines = symbols.get(symbol); if (strs.length > 0) { strs[0] = "none"; } if (lines != null && lines.contains(lineNumber)) { LineTagMap line_map = line_maps.get(lineNumber); if (line_map != null) { for (Tag tag : line_map.sym_tags.get(symbol)) { if (tag.used) { continue; } if (strs.length > 0) { strs[0] = tag.type; } tag.used = true; return true; } } } return false; } }
Definitions implements Serializable { public boolean hasDefinitionAt(String symbol, int lineNumber, String[] strs) { Set<Integer> lines = symbols.get(symbol); if (strs.length > 0) { strs[0] = "none"; } if (lines != null && lines.contains(lineNumber)) { LineTagMap line_map = line_maps.get(lineNumber); if (line_map != null) { for (Tag tag : line_map.sym_tags.get(symbol)) { if (tag.used) { continue; } if (strs.length > 0) { strs[0] = tag.type; } tag.used = true; return true; } } } return false; } Definitions(); }
Definitions implements Serializable { public boolean hasDefinitionAt(String symbol, int lineNumber, String[] strs) { Set<Integer> lines = symbols.get(symbol); if (strs.length > 0) { strs[0] = "none"; } if (lines != null && lines.contains(lineNumber)) { LineTagMap line_map = line_maps.get(lineNumber); if (line_map != null) { for (Tag tag : line_map.sym_tags.get(symbol)) { if (tag.used) { continue; } if (strs.length > 0) { strs[0] = tag.type; } tag.used = true; return true; } } } return false; } 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 boolean hasDefinitionAt(String symbol, int lineNumber, String[] strs) { Set<Integer> lines = symbols.get(symbol); if (strs.length > 0) { strs[0] = "none"; } if (lines != null && lines.contains(lineNumber)) { LineTagMap line_map = line_maps.get(lineNumber); if (line_map != null) { for (Tag tag : line_map.sym_tags.get(symbol)) { if (tag.used) { continue; } if (strs.length > 0) { strs[0] = tag.type; } tag.used = true; return true; } } } return false; } 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);  }