Revision 1207,
399 bytes
checked in by wojtekp, 11 years ago
(diff) |
|
-
Property svn:mime-type set to
text/plain
|
Line | |
---|
1 | package schedframe.resources.utils; |
---|
2 | |
---|
3 | import java.util.HashMap; |
---|
4 | |
---|
5 | public class ResourceIdGenerator { |
---|
6 | |
---|
7 | private static HashMap<String, Integer> resourceCounter = new HashMap<String, Integer>(); |
---|
8 | |
---|
9 | public static int getId(String key){ |
---|
10 | |
---|
11 | int value = 1; |
---|
12 | if(resourceCounter.containsKey(key)){ |
---|
13 | value = resourceCounter.get(key); |
---|
14 | value++; |
---|
15 | } |
---|
16 | resourceCounter.put(key, value); |
---|
17 | return value; |
---|
18 | } |
---|
19 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.