當前位置: 首頁>>代碼示例>>Java>>正文


Java UID.toString方法代碼示例

本文整理匯總了Java中java.rmi.server.UID.toString方法的典型用法代碼示例。如果您正苦於以下問題:Java UID.toString方法的具體用法?Java UID.toString怎麽用?Java UID.toString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.rmi.server.UID的用法示例。


在下文中一共展示了UID.toString方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testToString005

import java.rmi.server.UID; //導入方法依賴的package包/類
public final void testToString005() {

        uid = new UID();
        StringTokenizer st = new StringTokenizer(uid.toString(), ":");
        String s[] = new String[5];
        for (int i = 0; i < 3; i++) {
            s[i] = st.nextToken(":");
        }
        UID uid2 = new UID();
        StringTokenizer st2 = new StringTokenizer(uid2.toString(), ":");
        String s2[] = new String[5];
        for (int i = 0; i < 3; i++) {
            s2[i] = st2.nextToken(":");
        }
        for (int i = 0; i < 2; i++) {
            assertEquals(s[i], s2[i]);
        }
        assertNotSame(s[2], s2[2]);
    }
 
開發者ID:freeVM,項目名稱:freeVM,代碼行數:20,代碼來源:TestUID.java

示例2: setId

import java.rmi.server.UID; //導入方法依賴的package包/類
/**
 * Sets the id attribute of the Role object
 */
public void setId()
{
    // generate a unique id that will be used as the rDn for this entry:
    UID iid = new UID();
    // assign the unique id to the internal id of the entity:
    this.id = iid.toString();
}
 
開發者ID:apache,項目名稱:directory-fortress-core,代碼行數:11,代碼來源:Example.java

示例3: createTempDir

import java.rmi.server.UID; //導入方法依賴的package包/類
/**
 * Creates a folder in "java.io.tmpdir" with a unique name.
 */
public static File createTempDir() throws IOException {
  UID uid = new UID();
  File dir = new File(System.getProperty("java.io.tmpdir"));
  File tmp = new File(dir, uid.toString());
  if (!tmp.mkdirs()) {
    throw new IOException("Cannot create tmp dir [" + tmp.toString() + "]");
  }
  return tmp;
}
 
開發者ID:skidder,項目名稱:mythpodcaster,代碼行數:13,代碼來源:FileOperations.java

示例4: createSimpleUUID

import java.rmi.server.UID; //導入方法依賴的package包/類
/**
* Creates a Universally Unique Identifier, via the java.rmi.server.UID class.
*/
public static String createSimpleUUID() {
	UID uid = new UID();

	String uidString=asHex(getIPAddress())+"-"+uid.toString();
	// Replace semi colons by underscores, so IBIS will support it
	uidString = uidString.replace(':', '_');
	return uidString;
}
 
開發者ID:ibissource,項目名稱:iaf,代碼行數:12,代碼來源:Misc.java


注:本文中的java.rmi.server.UID.toString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。