lejosunit.util
Class Util

java.lang.Object
  extended bylejosunit.util.Util

public class Util
extends java.lang.Object

Some utility methods used in leJOSUnit.

Author:
Jochen Hiller

Constructor Summary
Util()
           
 
Method Summary
static void arraycopy(char[] src, int srcOffset, char[] dest, int destOffset, int length)
          Copies one array to another.
static java.lang.String concat(java.lang.String s1, java.lang.String s2)
          Concatenates two Strings without using StringBuffer, to avoid linking StringBuffer and therefore Math library.
static java.lang.String concat(java.lang.String s1, java.lang.String s2, java.lang.String s3)
          Concatenates three Strings without using StringBuffer, to avoid linking StringBuffer and therefore Math library.
static char[] convertTime(int t)
          Show elapsed time in an optimal way.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

arraycopy

public static void arraycopy(char[] src,
                             int srcOffset,
                             char[] dest,
                             int destOffset,
                             int length)
Copies one array to another. Taken from System. Can NOT be used, as it is in package scope.

Parameters:
src - the source array
srcOffset - the offset within source array
dest - the destination array
destOffset - the offset within destination array
length - the number of chars to copy

concat

public static java.lang.String concat(java.lang.String s1,
                                      java.lang.String s2)
Concatenates two Strings without using StringBuffer, to avoid linking StringBuffer and therefore Math library.

Parameters:
s1 - the first string
s2 - the second string
Returns:
the concatenated string. Will be allocated new.

concat

public static java.lang.String concat(java.lang.String s1,
                                      java.lang.String s2,
                                      java.lang.String s3)
Concatenates three Strings without using StringBuffer, to avoid linking StringBuffer and therefore Math library.

Parameters:
s1 - the first string
s2 - the second string
s3 - the third string
Returns:
the concatenated string. Will be allocated new.

convertTime

public static char[] convertTime(int t)
Show elapsed time in an optimal way.

Parameters:
t - the elapsed time
Returns:
the string (as char[]) to display. Always returns 5 characters.


Copyright (C) 2003 Jochen Hiller. All Rights Reserved.