com.vwp.util
Class Tools

java.lang.Object
  extended by com.vwp.util.Tools

public class Tools
extends Object

The Tools class is intended to be a container for functionalities which don't fit anywhere else.


Constructor Summary
Tools()
          Constructs a new Tools object.
 
Method Summary
 long calculateHash(String instr)
          Calculates some kind of hash or checksum out of a String.
static void threadSleep(long msecs)
          Lets the current Thread sleep for the specified amount of milliseconds.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tools

public Tools()
Constructs a new Tools object. This is necessary to initialize and instantiate objects and values which are used within this class. Independend from this fact, all Tools objects method can be (re)used afterwards without the necessarity to reinitialize or to create a new instance of it.

Method Detail

calculateHash

public long calculateHash(String instr)
Calculates some kind of hash or checksum out of a String. This checksum should be unique for different contents of this String, also if they differ only in some characters. Identically Strings of course would result in equal hash values.

Parameters:
instr - The input string to calculate the hash value from
Returns:
The unique has value which belongs to the input String

threadSleep

public static void threadSleep(long msecs)
Lets the current Thread sleep for the specified amount of milliseconds. This function encapsulates the InterruptedException, so only one simple method call is necessary.

Parameters:
msecs - the amount of milliseconds the thread has to sleep