blob: df26acdf46aba3da47919ad190b67bbfc906bb79 [file] [log] [blame]
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -08001
2import java.io.BufferedReader;
3import java.util.HashMap;
4
5public class ParameterChecker {
6
7 HashMap<String,String[]> map = new HashMap<String,String[]>();
8
9 public ParameterChecker(BufferedReader reader) throws Exception {
10 String s;
11 while ((s = reader.readLine()) != null) {
12 String[] tokens = s.split("\\s");
13 map.put(tokens[0], tokens);
14 }
15 }
16
17 public String[] getChecks(String functionName) {
18 String[] checks = map.get(functionName);
19 if (checks == null &&
20 (functionName.endsWith("fv") ||
21 functionName.endsWith("xv") ||
22 functionName.endsWith("iv"))) {
23 functionName = functionName.substring(0, functionName.length() - 2);
24 checks = map.get(functionName);
25 }
26 return checks;
27 }
28}