站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 common API Documentation 英文版文档

GUID (JBoss/Common API) - JBoss 4.0.1 sp1 common API Documentation 英文版文档


org.jboss.util.id
Class GUID

java.lang.Object
  extended byorg.jboss.util.id.GUID
All Implemented Interfaces:
Cloneable, Comparable, ID, Serializable

public class GUID
extends Object
implements ID, Comparable

A globally unique identifier (globally across a cluster of virtual machines).

The identifier is composed of:

  1. The VMID for the virtual machine.
  2. A UID to provide uniqueness over a VMID.
    [ address ] - [ process id ] - [ time ] - [ counter ] - [ time ] - [ counter ]
                                   |------- UID --------|   |------- UID --------|
    |---------------------- VMID -----------------------|
 

Version:
$Revision: 1.5.6.1 $
Author:
Jason Dillon
See Also:
VMID, UID, Serialized Form

Field Summary
protected  int hashCode
          The hash code of this GUID
protected  UID uid
          The unique identifier
protected  VMID vmid
          The virtual machine identifier
 
Constructor Summary
  GUID()
          Construct a new GUID.
protected GUID(GUID guid)
          Copy a GUID.
 
Method Summary
static String asString()
          Returns a GUID as a string.
 Object clone()
          Returns a copy of this GUID.
 int compareTo(Object o)
           
 boolean equals(Object obj)
          Check if the given object is equal to this GUID.
 UID getUID()
          Get the UID portion of this GUID.
 VMID getVMID()
          Get the VMID portion of this GUID.
 int hashCode()
          Return the hash code of this GUID.
 String toString()
          Return a string representation of this GUID.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

vmid

protected final VMID vmid
The virtual machine identifier


uid

protected final UID uid
The unique identifier


hashCode

protected final int hashCode
The hash code of this GUID

Constructor Detail

GUID

public GUID()
Construct a new GUID.


GUID

protected GUID(GUID guid)
Copy a GUID.

Parameters:
guid - GUID to copy.
Method Detail

getVMID

public final VMID getVMID()
Get the VMID portion of this GUID.

Returns:
The VMID portion of this GUID.

getUID

public final UID getUID()
Get the UID portion of this GUID.

Returns:
The UID portion of this GUID.

toString

public String toString()
Return a string representation of this GUID.

Returns:
A string representation of this GUID.

hashCode

public int hashCode()
Return the hash code of this GUID.

Returns:
The hash code of this GUID.

equals

public boolean equals(Object obj)
Check if the given object is equal to this GUID.

A GUID is equal to another GUID if the VMID and UID portions are equal.

Parameters:
obj - Object to test equality with.
Returns:
True if object is equal to this GUID.

clone

public Object clone()
Returns a copy of this GUID.

Returns:
A copy of this GUID.

asString

public static String asString()
Returns a GUID as a string.

Returns:
GUID as a string.

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.