| java.lang.Object com.sqlmagic.tinysql.Utils
Utils | public class Utils (Code) | | Some helper methods for tinySQL
author: Brian Jepson author: Marcel Ruff Added write access to dBase and JDK 2 support |
Method Summary | |
public static boolean | clearFunction(String inputName) | final public static void | delFile(String fname) | final public static void | delFile(String dataDir, String fname) | public static boolean | endsWithFunctionName(String inputName) | final public static short | fixByte(byte b) | final public static String | forceToSize(String str, int size, String padChar) | final public static byte[] | forceToSize(String str, int size, byte padByte) | final public static Vector | getAllFiles(String path, String suffix) | final public static byte[] | intToLittleEndian(int val) | public static boolean | isCharColumn(int columnType) | public static boolean | isDateColumn(int columnType) | public static boolean | isFunctionName(String inputName) | public static boolean | isNumberColumn(int columnType) | final static void | log(String id, String str) | final static void | log(String str) | final public static boolean | renameFile(String oldName, String newName) | public static void | setPriority(Vector inputList, String inputTable) | final public static byte[] | shortToLittleEndian(short val) | final public static String | stripPathAndExtension(String file) | final public static double | vax_to_long(byte[] b) Converts a little-endian four-byte array to a long,
represented as a double, since long is signed.
I don't know why Java doesn't supply this. | final public static int | vax_to_short(byte[] b) Converts a little-endian four-byte array to a short,
represented as an int, since short is signed.
I don't know why Java doesn't supply this. |
debug | final static boolean debug(Code) | | For debugging/tracing
Switch the debug mode on/off:
|
clearFunction | public static boolean clearFunction(String inputName)(Code) | | |
endsWithFunctionName | public static boolean endsWithFunctionName(String inputName)(Code) | | |
fixByte | final public static short fixByte(byte b)(Code) | | |
forceToSize | final public static String forceToSize(String str, int size, String padChar)(Code) | | Cut or padd the string to the given size
Parameters: a - string Parameters: size - the wanted length Parameters: padChar - char to use for padding (must be of length()==1!) the string with correct lenght, padded with pad if necessary |
forceToSize | final public static byte[] forceToSize(String str, int size, byte padByte) throws java.io.UnsupportedEncodingException(Code) | | Cut or padd the string to the given size
Parameters: a - string Parameters: size - the wanted length Parameters: padByte - char to use for padding the string with correct lenght, padded with pad if necessary |
intToLittleEndian | final public static byte[] intToLittleEndian(int val)(Code) | | Converts a long to a little-endian four-byte array
|
isCharColumn | public static boolean isCharColumn(int columnType)(Code) | | |
isDateColumn | public static boolean isDateColumn(int columnType)(Code) | | |
isFunctionName | public static boolean isFunctionName(String inputName)(Code) | | |
isNumberColumn | public static boolean isNumberColumn(int columnType)(Code) | | |
renameFile | final public static boolean renameFile(String oldName, String newName)(Code) | | rename a file
true if succeeded |
shortToLittleEndian | final public static byte[] shortToLittleEndian(short val)(Code) | | Converts a long to a little-endian two-byte array
|
stripPathAndExtension | final public static String stripPathAndExtension(String file)(Code) | | Strip the path and suffix of a file name
Parameters: file - "/usr/local/dbase/test.DBF" "test" |
vax_to_long | final public static double vax_to_long(byte[] b)(Code) | | Converts a little-endian four-byte array to a long,
represented as a double, since long is signed.
I don't know why Java doesn't supply this. It could
be that it's there somewhere, but I looked and couldn't
find it.
|
vax_to_short | final public static int vax_to_short(byte[] b)(Code) | | Converts a little-endian four-byte array to a short,
represented as an int, since short is signed.
I don't know why Java doesn't supply this. It could
be that it's there somewhere, but I looked and couldn't
find it.
|
|
|