Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.activemq.util
Class IdGenerator

    java.lang.Object
      org.codehaus.activemq.util.IdGenerator

public class IdGenerator
extends java.lang.Object

Generator for globally unique Strings

Version:
  $Revision: 1.1 $

Constructor Summary
`IdGenerator()` Construct an IdGenerator

Method Summary
`static int` | `compare(java.lang.String id1, java.lang.String id2)` Does a proper compare on the ids
`java.lang.String` | `generateId()` Generate a unqiue id
`static long` | `getCountFromId(java.lang.String id)` From a generated id - return the generator count
`static java.lang.String` | `getHostName()` As we have to find the hostname as a side-affect of generating a unique stub, we allow it's easy retrevial here
`java.lang.String` | `getSeed()`
`static java.lang.String` | `getSeedFromId(java.lang.String id)` From a generated id - return the seed (i.e.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### IdGenerator

    public IdGenerator()

  Construct an IdGenerator

Method Detail

### getHostName

    public static java.lang.String getHostName()

  As we have to find the hostname as a side-affect of generating a unique stub, we allow it's easy retrevial here

  Returns:
    the local host name

### generateId

    public java.lang.String generateId()

  Generate a unqiue id

  Returns:
    a unique id

### getSeed

    public java.lang.String getSeed()

  Returns:
    the unique seed used by this generator

### getSeedFromId

    public static java.lang.String getSeedFromId(java.lang.String id)

  From a generated id - return the seed (i.e. minus the count)

  Parameters:
    `id` - the generated identifer
  Returns:

### getCountFromId

    public static long getCountFromId(java.lang.String id)

  From a generated id - return the generator count

  Parameters:
    `id` -
  Returns:
    the count

### compare

    public static int compare(java.lang.String id1,
                              java.lang.String id2)

  Does a proper compare on the ids

  Parameters:
    `id1` -
    `id2` -
  Returns:

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 Protique, Ltd.. All Rights Reserved.