|
From: David C. <dc...@us...> - 2005-11-19 20:23:33
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/symbols In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22214/src/org/rubypeople/rdt/internal/core/symbols Modified Files: SymbolIndex.java Added Files: ISymbolFinder.java Log Message: Introduce ISymbolFinder, and change SymbolIndex clients accordingly. --- NEW FILE: ISymbolFinder.java --- package org.rubypeople.rdt.internal.core.symbols; import java.util.Set; import java.util.regex.PatternSyntaxException; public interface ISymbolFinder { public abstract Set find(Symbol symbol); /* * returns a set of SearchResult instances as opposed to find(symbol), which returns locations */ public abstract Set find(String regExp, int symbolType) throws PatternSyntaxException; } Index: SymbolIndex.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/symbols/SymbolIndex.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** SymbolIndex.java 13 Nov 2005 13:05:12 -0000 1.10 --- SymbolIndex.java 19 Nov 2005 20:23:25 -0000 1.11 *************** *** 25,31 **** import org.jruby.lexer.yacc.ISourcePosition; ! public class SymbolIndex { ! ! private Map index = Collections.synchronizedMap(new HashMap()); private static boolean verbose; --- 25,29 ---- import org.jruby.lexer.yacc.ISourcePosition; ! public class SymbolIndex implements ISymbolFinder { private Map index = Collections.synchronizedMap(new HashMap()); private static boolean verbose; *************** *** 48,51 **** --- 46,52 ---- } + /* (non-Javadoc) + * @see org.rubypeople.rdt.internal.core.symbols.ISymbolFinder#find(org.rubypeople.rdt.internal.core.symbols.Symbol) + */ public Set find(Symbol symbol) { Set locations = (Set) index.get(symbol); *************** *** 58,61 **** --- 59,65 ---- * returns a set of SearchResult instances as opposed to find(symbol), which returns locations */ + /* (non-Javadoc) + * @see org.rubypeople.rdt.internal.core.symbols.ISymbolFinder#find(java.lang.String, int) + */ public Set find(String regExp, int symbolType) throws PatternSyntaxException { Pattern pattern = Pattern.compile(regExp); |