Created
May 18, 2012 02:35
-
-
Save tmahesh/2722826 to your computer and use it in GitHub Desktop.
is there a memory impact?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option 1: | |
@Component | |
public class RewriteQueryDictionary { | |
public RewriteQueryDictionary(){ | |
MapDictionary<String> dictionary = new MapDictionary<String>(); | |
initializeFileKeywordsDictionary(dictionary); | |
//more code here | |
} | |
private boolean initializeFileKeywordsDictionary(MapDictionary<String> dictionary) { | |
while(big loop){ | |
dictionary.addEntry(new DictionaryEntry<String>(keyword, type, CHUNK_SCORE)); | |
} | |
} | |
} | |
Option 2: | |
@Component | |
public class RewriteQueryDictionary { | |
MapDictionary<String> dictionary = new MapDictionary<String>(); | |
public RewriteQueryDictionary(){ | |
initializeFileKeywordsDictionary(dictionary); | |
//more code here | |
} | |
private boolean initializeFileKeywordsDictionary(MapDictionary<String> dictionary) { | |
while(big loop){ | |
dictionary.addEntry(new DictionaryEntry<String>(keyword, type, CHUNK_SCORE)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment