jgroup.util
Class Util

java.lang.Object
  extended by jgroup.util.Util

public final class Util
extends java.lang.Object

The Util class implements various useful static methods that can be invoked from anywhere.

Since:
Jgroup 0.1
Author:
Alberto Montresor, Hein Meling

Method Summary
static java.lang.String byte2str(byte value)
          Converts the given byte value to a string value aligned to three characters; it can be used to make message outputs print nicely.
static java.lang.String getDateString()
          Return a stringified date value.
static java.lang.String getDateTimeString()
          Return a stringified date and clock time value.
static java.lang.String getTimeString()
          Return a stringified clock time value.
static boolean in(java.lang.Object[] array, java.lang.Object obj)
          Return true if an object equal to obj is contained in array.
static int referenceAt(java.lang.Object[] array, java.lang.Object key)
           
static void sleep(long time)
          Wrapper for the Thread.sleep() method.
static int valueAt(int[] array, int key)
          Searches the specified array of ints for the specified value using the sequential search algorithm.
static int valueAt(java.lang.Object[] array, java.lang.Object key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

valueAt

public static int valueAt(int[] array,
                          int key)
Searches the specified array of ints for the specified value using the sequential search algorithm. The array must be sorted prior to making this call.

Parameters:
array - the array to be searched.
key - the value to be searched for.
Returns:
index of the search key, if it is contained in the array; otherwise, array.length.

valueAt

public static int valueAt(java.lang.Object[] array,
                          java.lang.Object key)

referenceAt

public static int referenceAt(java.lang.Object[] array,
                              java.lang.Object key)

in

public static boolean in(java.lang.Object[] array,
                         java.lang.Object obj)
Return true if an object equal to obj is contained in array.


getDateString

public static java.lang.String getDateString()
Return a stringified date value. The format is as follows:

yyyymmdd

Returns:
A string representation of the current date.

getTimeString

public static java.lang.String getTimeString()
Return a stringified clock time value. The format is as follows:

hhmmss

Returns:
A string representation of the current time.

getDateTimeString

public static java.lang.String getDateTimeString()
Return a stringified date and clock time value. The format is as follows:

yyyymmdd-hhmm

Returns:
A string representation of the current date and time.

byte2str

public static java.lang.String byte2str(byte value)
Converts the given byte value to a string value aligned to three characters; it can be used to make message outputs print nicely.


sleep

public static void sleep(long time)
Wrapper for the Thread.sleep() method.

Parameters:
time - the time in milliseconds to sleep.


Copyright © 1998-2006 The Jgroup/ARM development team. All Rights Reserved.