KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > polyglot > util > UniqueID


1 package polyglot.util;
2
3 /** A unique identifier generator. */
4 public class UniqueID {
5     private static int count = 0;
6     private static int icount = 0;
7
8     public static String JavaDoc newID(String JavaDoc s) {
9     String JavaDoc uid = s + "$" + count;
10     count++;
11     return uid;
12     }
13
14     public static int newIntID() {
15     return icount++;
16     }
17 }
18
Popular Tags