Revision 1120,
997 bytes
checked in by dresiu, 12 years ago
(diff) |
dresiu init commit
|
Line | |
---|
1 | package test.drs_tst.recs.utils.appprofiles; |
---|
2 | |
---|
3 | import java.util.HashMap; |
---|
4 | import java.util.Map; |
---|
5 | |
---|
6 | public class ProfileGetter { |
---|
7 | |
---|
8 | private static final Map<String, Class> profileNameMap; |
---|
9 | static |
---|
10 | { |
---|
11 | profileNameMap = new HashMap<String, Class>(); |
---|
12 | profileNameMap.put("abinit", AbinitProfile.class); |
---|
13 | profileNameMap.put("lin_tiny", LinTinyProfile.class); |
---|
14 | profileNameMap.put("c_ray", CRayProfile.class); |
---|
15 | profileNameMap.put("lin_3gb", Lin3GBProfile.class); |
---|
16 | profileNameMap.put("tar", TarProfile.class); |
---|
17 | profileNameMap.put("fft", FFTProfile.class); |
---|
18 | } |
---|
19 | |
---|
20 | public static ApplicationProfileBase getProfileWithName(String name){ |
---|
21 | try { |
---|
22 | return (ApplicationProfileBase) profileNameMap.get(name).newInstance(); |
---|
23 | } catch (InstantiationException e) { |
---|
24 | // TODO Auto-generated catch block |
---|
25 | return null; |
---|
26 | } catch (IllegalAccessException e) { |
---|
27 | // TODO Auto-generated catch block |
---|
28 | return null; |
---|
29 | } |
---|
30 | } |
---|
31 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.