-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.utils;\r
-\r
-import java.util.Random;\r
-\r
-/**\r
- * UniqueID attempts to creates unique IDs. \r
- * @author Toni Kalajainen\r
- * @deprecated should be removed in my opinion [Tuukka], no real use.\r
- */\r
-public class UniqueID {\r
- \r
- public static final String RESTORE_PREFIX = "restore-";\r
- \r
- protected final static Random RANDOM = new Random(System.currentTimeMillis());\r
- protected static long COUNTER = RANDOM.nextLong();\r
- \r
- public static String _createUniqueID() {\r
- synchronized(UniqueID.class) {\r
- Long value = COUNTER++;\r
- Long random = RANDOM.nextLong();\r
- return Long.toHexString(value).toUpperCase() + \r
- Long.toHexString(random);\r
- }\r
- } \r
-\r
- public static String createViewSiteSecondaryID(boolean restore) {\r
- if (!restore)\r
- return _createUniqueID();\r
- return RESTORE_PREFIX+_createUniqueID();\r
- }\r
- \r
- \r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.utils;
+
+import java.util.Random;
+
+/**
+ * UniqueID attempts to creates unique IDs.
+ * @author Toni Kalajainen
+ * @deprecated should be removed in my opinion [Tuukka], no real use.
+ */
+public class UniqueID {
+
+ public static final String RESTORE_PREFIX = "restore-";
+
+ protected final static Random RANDOM = new Random(System.currentTimeMillis());
+ protected static long COUNTER = RANDOM.nextLong();
+
+ public static String _createUniqueID() {
+ synchronized(UniqueID.class) {
+ Long value = COUNTER++;
+ Long random = RANDOM.nextLong();
+ return Long.toHexString(value).toUpperCase() +
+ Long.toHexString(random);
+ }
+ }
+
+ public static String createViewSiteSecondaryID(boolean restore) {
+ if (!restore)
+ return _createUniqueID();
+ return RESTORE_PREFIX+_createUniqueID();
+ }
+
+
+}