Revision 816,
442 bytes
checked in by wojtekp, 12 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 | import schedframe.resources.ResourceType; |
---|
6 | |
---|
7 | public class ResourceIdGenerator { |
---|
8 | |
---|
9 | private static HashMap<String, Integer> resourceCounter = new HashMap<String, Integer>(); |
---|
10 | |
---|
11 | public static int getId(String key){ |
---|
12 | |
---|
13 | int value = 0; |
---|
14 | if(resourceCounter.containsKey(key)){ |
---|
15 | value = resourceCounter.get(key); |
---|
16 | value++; |
---|
17 | } |
---|
18 | resourceCounter.put(key, value); |
---|
19 | return value; |
---|
20 | } |
---|
21 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.