public class Utility
extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
VERSION
The version information.
|
| Modifier and Type | Method and Description |
|---|---|
static double |
atof(String str)
Convert a string to a real number.
|
static long |
atoi(String str)
Convert a string with a metric prefix to an integer.
|
static long |
atoix(String str)
Convert a string with a metric prefix to an integer.
|
static long |
hash_fnv(byte[] data)
Get the hash value of a byte array by FNV hashing.
|
static long |
hash_murmur(byte[] data)
Get the hash value of a byte array by MurMur hashing.
|
static long |
levdist(byte[] a,
byte[] b)
Calculate the levenshtein distance of two strings.
|
static long |
levdist(String a,
String b)
Calculate the levenshtein distance of two strings.
|
static boolean |
remove_files_recursively(String path)
Remove a file or a directory recursively.
|
static double |
time()
Get the current time.
|
public static double atof(String str)
str - specifies the string.public static long atoi(String str)
str - the string.public static long atoix(String str)
str - the string, which can be trailed by a binary metric prefix. "K", "M", "G", "T",
"P", and "E" are supported. They are case-insensitive.public static long hash_fnv(byte[] data)
data - the byte array.public static long hash_murmur(byte[] data)
data - the byte array.public static long levdist(byte[] a,
byte[] b)
a - one string.b - the other string.public static long levdist(String a,
String b)
levdist(byte[], byte[])public static boolean remove_files_recursively(String path)
path - the path of a file or a directory.public static double time()