当前位置: 首页>>代码示例>>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;未经允许,请勿转载。