org.rapla.components.util
Class Tools

java.lang.Object
  extended by org.rapla.components.util.Tools

public abstract class Tools
extends Object

miscellaneous util methods.


Field Summary
static Object[] EMPTY_ARRAY
          same as new Object[0].
static Class[] EMPTY_CLASS_ARRAY
           
static Iterator EMPTY_ITERATOR
           
static List EMPTY_LIST
          an unmodifiable list with no elements.
static Set EMPTY_SET
          an unmodifiable set with no elements.
static String[] EMPTY_STRING_ARRAY
           
 
Constructor Summary
Tools()
           
 
Method Summary
static String convert(byte[] bytes)
          Convert a byte array into a printable format containing aString of hexadecimal digit characters (two per byte).
static char convertDigit(int value)
          Convert the specified value (0-15) to the corresponding hexadecimal digit.
static String[][] csvRead(Reader reader, int expectedColumns)
          reads a table from a csv file.
static boolean equalsOrBothNull(Object o1, Object o2)
           
static boolean isKey(String key)
          Rudimentary tests if the string is a valid xml-tag.
static String left(String string, int width)
          same as substring(0,width-1) except that it will not not throw an ArrayIndexOutOfBoundsException if string.length()<width.
static boolean match(char[] p1, char[] p2)
          test if 2 char arrays match.
static String replaceAll(String string, String stringToReplace, String newString)
          1.3 compatibility method
static String[] split(String stringToSplit, char delimiter)
          1.3 compatibility method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_ARRAY

public static Object[] EMPTY_ARRAY
same as new Object[0].


EMPTY_CLASS_ARRAY

public static Class[] EMPTY_CLASS_ARRAY

EMPTY_STRING_ARRAY

public static String[] EMPTY_STRING_ARRAY

EMPTY_ITERATOR

public static Iterator EMPTY_ITERATOR

EMPTY_LIST

public static List EMPTY_LIST
an unmodifiable list with no elements.


EMPTY_SET

public static Set EMPTY_SET
an unmodifiable set with no elements.

Constructor Detail

Tools

public Tools()
Method Detail

match

public static boolean match(char[] p1,
                            char[] p2)
test if 2 char arrays match.


isKey

public static boolean isKey(String key)
Rudimentary tests if the string is a valid xml-tag.


left

public static String left(String string,
                          int width)
same as substring(0,width-1) except that it will not not throw an ArrayIndexOutOfBoundsException if string.length()<width.


convert

public static String convert(byte[] bytes)
Convert a byte array into a printable format containing aString of hexadecimal digit characters (two per byte). This method is taken form the apache jakarata tomcat project.


convertDigit

public static char convertDigit(int value)
Convert the specified value (0-15) to the corresponding hexadecimal digit. This method is taken form the apache jakarata tomcat project.


equalsOrBothNull

public static boolean equalsOrBothNull(Object o1,
                                       Object o2)

split

public static String[] split(String stringToSplit,
                             char delimiter)
1.3 compatibility method


replaceAll

public static String replaceAll(String string,
                                String stringToReplace,
                                String newString)
1.3 compatibility method


csvRead

public static String[][] csvRead(Reader reader,
                                 int expectedColumns)
                          throws IOException
reads a table from a csv file. You can specify a minimum number of columns

Throws:
IOException


Copyright © 2000-2006 Rapla Team. All Rights Reseserved.