de.uplanet.lucy.server.auxiliaries
Class Unique

java.lang.Object
  extended by de.uplanet.lucy.server.auxiliaries.Unique

@VelocityCallable(value="singleton")
public class Unique
extends java.lang.Object

Utility class to create unique identifiers and names.

Version:
$Revision: 28455 $

Constructor Summary
Unique()
          Constructor.
 
Method Summary
 boolean isGuid(java.lang.String p_strId)
          Test wether the given string is a GUID.
 java.lang.String newGuid()
          Create a new GUID.
 int newUniqueInt()
          Create a new GUID and return it's absolute hash code.
 java.lang.String newVariableName()
          Create a new unique variable name with the prefix l_id followed by up to nineteen decimal digits.
 java.lang.String newVariableName(java.lang.String p_strPrefix)
          Create a new unique variable name with a specified prefix followed by up to nineteen decimal digits.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Unique

public Unique()
Constructor.

Method Detail

newGuid

public java.lang.String newGuid()
Create a new GUID.

Returns:
The new GUID's string representation.

newUniqueInt

public int newUniqueInt()
Create a new GUID and return it's absolute hash code.

Returns:
A unique integer.

isGuid

public boolean isGuid(java.lang.String p_strId)
Test wether the given string is a GUID.

Parameters:
p_strId - The string to test.
Returns:
true if the given string is a GUID, false otherwise.

newVariableName

public java.lang.String newVariableName()
Create a new unique variable name with the prefix l_id followed by up to nineteen decimal digits.

Returns:
The newly created unique variable name.

newVariableName

public java.lang.String newVariableName(java.lang.String p_strPrefix)
Create a new unique variable name with a specified prefix followed by up to nineteen decimal digits.

Parameters:
p_strPrefix - The prefix to be used.
Returns:
The newly created unique variable name.


Last updated: 2011-01-27
Copyright 2000-2010 United Planet. All Rights Reserved.