public final class Convert
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static char[] |
b2h |
static AbstractCharacterConverter |
charConverter
The bytes are converted to char and vice-versa using the CharacterConverter associated in this charConverter member.
|
static java.lang.String |
CRLF |
static byte[] |
CRLF_BYTES |
static long |
DOUBLE_NAN_BITS |
static double |
DOUBLE_NAN_VALUE |
static long |
DOUBLE_NEGATIVE_INFINITY_BITS |
static double |
DOUBLE_NEGATIVE_INFINITY_VALUE |
static long |
DOUBLE_POSITIVE_INFINITY_BITS |
static double |
DOUBLE_POSITIVE_INFINITY_VALUE |
static char |
MAX_CHAR_VALUE
The maximum char value:
|
static int |
MAX_DOUBLE_DIGITS
The maximum number of digits in a double value, used when formatting to string.
|
static double |
MAX_DOUBLE_VALUE
The maximum double value: 1.7976931348623157E308d
|
static int |
MAX_INT_VALUE
The maximum int value: 2147483647
|
static long |
MAX_LONG_VALUE
The maximum long value: 9223372036854775807
|
static short |
MAX_SHORT_VALUE
The maximum short value: 32767
|
static char |
MIN_CHAR_VALUE
The minimum char value: ' '
|
static double |
MIN_DOUBLE_VALUE
The minimum double value: 4.9E-324d
|
static int |
MIN_INT_VALUE
The minimum int value: -2147483648
|
static long |
MIN_LONG_VALUE
The minimum long value: -9223372036854775808
|
static short |
MIN_SHORT_VALUE
The minimum short value: -32768
|
static int |
SORT_AUTODETECT
To be used in the qsort method; the type of sort will be automatically detected.
|
static int |
SORT_COMPARABLE
To be used in the qsort method; the Object array contain Comparable objects.
|
static int |
SORT_DATE
To be used in the qsort method; the Object array contain String objects that represents a Date with day, month and year.
|
static int |
SORT_DOUBLE
To be used in the qsort method; the Object array contain String objects that represents a double.
|
static int |
SORT_INT
To be used in the qsort method; the Object array contain String objects that represents an integer.
|
static int |
SORT_OBJECT
To be used in the qsort method; the Object array will be compared converting to string.
|
static int |
SORT_STRING
To be used in the qsort method; the Object array contain String objects (case sensitive).
|
static int |
SORT_STRING_NOCASE
To be used in the qsort method; the Object array contain String objects, using a case insensitive (and slower) algorithm.
|
Modifier and Type | Method and Description |
---|---|
static void |
append(java.lang.StringBuffer sb,
char c,
int count)
This method appends a number of characters into a StringBuffer.
|
static java.lang.String |
appendPath(java.lang.String path1,
java.lang.String path2)
Concatenates two strings ensuring there's a single slash between them.
|
static java.lang.StringBuffer |
appendTimeStamp(java.lang.StringBuffer sb,
Time t,
boolean appendDate,
boolean appendTime)
Appends the given timestamp to a StringBuffer, using the current Date format and separators.
|
static java.lang.String |
bytesToHexString(byte[] b)
Converts the given sequence of bytes to a String.
|
static java.lang.String |
bytesToHexString(byte[] b,
int off,
int len)
Converts the given sequence of bytes to a String.
|
static int |
chars2int(java.lang.String fourChars)
Convert a creator id or a type to an int.
|
static java.nio.charset.Charset |
charsetForName(java.lang.String charsetName)
Returns a charset object for the named charset.
|
static java.lang.String[] |
cloneStringArray(java.lang.String[] strs)
Creates a copy of the given array.
|
static int |
detectSortType(java.lang.Object item)
Returns the sort type for the given item sample (which is usually the first item of the array being sorted) based on:
If item is not of String type, SORT_OBJECT is returned.
|
static int |
digitOf(char ch,
int radix)
returns the value of the digit in the specified radix.
|
static int |
doubleToIntBits(double f)
Converts the given double to its bit representation in IEEE 754 format, using 4 bytes instead of 8 (a convertion to float is applied).
|
static long |
doubleToLongBits(double value)
Returns a representation of the specified floating-point value
according to the IEEE 754 floating-point "double
format" bit layout.
|
static java.lang.String |
dup(char c,
int count)
Duplicates the given char
count times. |
static boolean |
equals(byte[] b1,
byte[] b2) |
static void |
fill(boolean[] a,
int from,
int to,
boolean value)
Fills the given array, within the range, with the value specified.
|
static void |
fill(byte[] a,
int from,
int to,
int value)
Fills the given array, within the range, with the value specified.
|
static void |
fill(char[] a,
int from,
int to,
char value)
Fills the given array, within the range, with the value specified.
|
static void |
fill(double[] a,
int from,
int to,
double value)
Fills the given array, within the range, with the value specified.
|
static void |
fill(int[] a,
int from,
int to,
int value)
Fills the given array, within the range, with the value specified.
|
static void |
fill(long[] a,
int from,
int to,
long value)
Fills the given array, within the range, with the value specified.
|
static void |
fill(java.lang.Object[] a,
int from,
int to,
java.lang.Object value)
Fills the given array, within the range, with the value specified.
|
static void |
fill(short[] a,
int from,
int to,
int value)
Fills the given array, within the range, with the value specified.
|
static char |
forDigit(int digit,
int radix)
returns the digit in the corresponding radix.
|
static int |
getBreakPos(FontMetrics fm,
java.lang.StringBuffer sb,
int start,
int width,
boolean doWordWrap)
Finds the best position to break the line, with word-wrap and respecting \n.
|
static byte[] |
getBytes(java.lang.StringBuffer sb)
Returns the bytes of the given StringBuffer using the current CharacterConverter instance.
|
static double |
getDistancePoint2Rect(int x,
int y,
int x1,
int y1,
int x2,
int y2)
Computes the distance between a point (x,y)
and a rectangle (corners x1,y1 and x2,y2).
|
static java.lang.String |
getFileName(java.lang.String fullPath)
Given a full path name, returns the name of the file.
|
static java.lang.String |
getFileNameOnly(java.lang.String fullPath)
Given a full path name or a single file name, returns the name of the file without the extension.
|
static java.lang.String |
getFilePath(java.lang.String fullPath)
Given a full path name, returns the normalized path of the file, without the slash.
|
static int |
hashCode(java.lang.StringBuffer sb)
Gets the hashcode of the string being stored by this StringBuffer.
|
static int |
hex2signed(java.lang.String s)
Returns an int with the conversion of the signed hexadecimal to integer.
|
static int |
hex2unsigned(java.lang.String s)
Returns an int with the conversion of the unsigned hexadecimal to integer.
|
static byte[] |
hexStringToBytes(java.lang.String s)
Converts the given String into an array of bytes.
|
static byte[] |
hexStringToBytes(java.lang.String s,
boolean ignoreNonHexChars)
Converts the given String into an array of bytes.
|
static void |
insertAt(java.lang.StringBuffer sb,
int pos,
char c)
Inserts the given char at the position in the StringBuffer.
|
static java.lang.String |
insertLineBreak(int maxWidth,
FontMetrics fm,
java.lang.String text)
This method is useful to insert line breaks into the text used in the MessageBox constructor.
|
static java.lang.String |
insertLineBreakBalanced(int maxWidth,
FontMetrics fm,
java.lang.String text)
This method is useful to insert line breaks into the text used in the Toast.show; it behaves like
insertLineBreak but tries to split the string in a balanced number of chars.
|
static java.lang.String |
int2chars(int i)
Convert an int to a creator id or a type.
|
static double |
intBitsToDouble(int i)
Converts the given IEEE 754 bit representation of a float to a double.
|
static byte[] |
ints2bytes(int[] from,
int count)
Converts the given int array into a byte array.
|
static boolean |
isLowerCase(char c)
Returns true if the given char is in lowercase.
|
static boolean |
isUpperCase(char c)
Returns true if the given char is in uppercase.
|
static double |
longBitsToDouble(long bits)
Returns the double-float corresponding to a given bit represention.
|
static int |
max(int... ai)
Returns the maximum value among the given ints
|
static int |
min(int... ai)
Returns the minimum value among the given ints
|
static java.lang.String |
normalizePath(java.lang.String path)
Normalizes a string using / as the path separator and removing any duplicate separators.
|
static int |
numberOf(java.lang.String s,
char c)
Returns the number of chars in a String.
|
static java.lang.String |
numberPad(int s,
int size)
Converts the int to String and pads it with the char 160 (that have the same width of a number) at left.
|
static java.lang.String |
numberPad(java.lang.String s,
int size)
Pads the given string with the char 160 (that have the same width of a number), putting it before or after the string.
|
static void |
qsort(java.lang.Object[] items,
int first,
int last)
Applies the Quick Sort algorithm to the elements of the given array.
|
static void |
qsort(java.lang.Object[] items,
int first,
int last,
int sortType)
Applies the Quick Sort algorithm to the elements of the given array, sorting in ascending order.
|
static void |
qsort(java.lang.Object[] items,
int first,
int last,
int sortType,
boolean ascending)
Applies the Quick Sort algorithm to the elements of the given array, in ascending or descending order.
|
static void |
registerCharacterConverter(AbstractCharacterConverter characterConverter)
Registers the given subclass of AbstractCharacterConverter to the list of
encodings supported to this instance of the running TotalCross VM
|
static java.lang.String |
remove(java.lang.String source,
java.lang.String chars)
Removes the given set of chars from the String.
|
static java.lang.String |
removeAccentuation(java.lang.String s)
Returns the given string without accentuation characters, using the unicode range 0-255
|
static java.lang.String |
replace(java.lang.String source,
java.lang.String from,
java.lang.String to)
Replace all occurences of the
from String by the to String in the given source String. |
static long |
rol(long i,
int n,
int bits)
Do a rol of n bits in the given i(nt).
|
static long |
ror(long i,
int n,
int bits)
Do a ror of n bits in the given i(nt).
|
static boolean |
setDefaultConverter(java.lang.String name)
Changes the default Character Converter to the given one.
|
static java.lang.String |
spacePad(java.lang.String what,
int count,
boolean before)
Pads the given string with spaces, putting it before or after the string.
|
static int |
sum(int... ai)
Returns the sum of the given ints
|
static int |
sum(int[] ai,
int startIndex,
int endIndex)
Returns the sum of the given ints, in the given range (startIndex <= x < endIndex).
|
static java.lang.String |
toCurrencyString(double d,
int decimalPlaces)
Returns the given double formatted using the Settings decimal and thousands separators.
|
static java.lang.String |
toCurrencyString(java.lang.String s,
int decimalPlaces)
Returns the given double formatted using the Settings decimal and thousands separators.
|
static double |
toDouble(java.lang.String s)
Converts the String to a double.
|
static double |
toDouble(java.lang.String s,
double defaultValue)
Converts the given String to a double.
|
static int |
toInt(java.lang.String s)
Converts the given String to an int.
|
static int |
toInt(java.lang.String s,
int defaultValue)
Converts the given String to an int.
|
static java.lang.String[] |
tokenizeArguments(java.lang.String arg)
Tokenizes a command line arguments, breaking it into an array of strings.
|
static java.lang.String[] |
tokenizeString(java.lang.String input,
char... delims)
Splits the specified string around matches of the given delimiters.
|
static java.lang.String[] |
tokenizeString(java.lang.String input,
char delim)
Tokenize the given input string.
|
static java.lang.String[] |
tokenizeString(java.lang.String input,
java.lang.String delim)
Tokenize the given input string.
|
static long |
toLong(java.lang.String s)
Converts the String to a long.
|
static long |
toLong(java.lang.String s,
int radix)
Converts the String to a long in the given radix.
|
static char |
toLowerCase(char c)
Converts the char to lower case letter
|
static short |
toShort(java.lang.String s)
Convert a string to the short type.
|
static java.lang.String |
toString(boolean b)
Converts the given boolean to a String.
|
static java.lang.String |
toString(char c)
Converts the given char to a String.
|
static java.lang.String |
toString(double d)
Converts the given double to a String, formatting it using scientific notation.
|
static java.lang.String |
toString(double val,
int decimalCount)
Converts the given double to a String, formatting it with the given number of decimal places.
|
static java.lang.String |
toString(int i)
Converts the given int to a String.
|
static java.lang.String |
toString(int i,
int radix)
Converts the int to a String in the given radix.
|
static java.lang.String |
toString(long l)
Converts the long to a String at base 10.
|
static java.lang.String |
toString(long i,
int radix)
Converts the long to a String in the given radix.
|
static java.lang.String |
toString(java.lang.String doubleValue,
int n)
formats a String as a double, rounding with n decimal places.
|
static java.lang.String |
toString4D(long i,
int radix) |
static java.lang.String[] |
toStringArray(java.lang.Object[] objs)
Converts the given object array to a String array by calling toString in each object.
|
static char |
toTitleCase(char ch)
Converts a Unicode character into its titlecase equivalent mapping.
|
static char |
toUpperCase(char c)
Converts the char to upper case letter
|
static java.lang.String |
unsigned2hex(int b,
int places)
Returns a String with the conversion of the unsigned integer to hexadecimal, using the given number of places (up
to 8).
|
static java.lang.String |
zeroPad(int s,
int size)
Converts the int to String and pads it with zeroes at left.
|
static java.lang.String |
zeroPad(java.lang.String s,
int size)
Pads the string with zeroes at left.
|
static java.lang.String |
zeroUnpad(java.lang.String s)
Strips the left zeros of the String.
|
public static final java.lang.String CRLF
public static final byte[] CRLF_BYTES
public static char[] b2h
public static AbstractCharacterConverter charConverter
public static final char MIN_CHAR_VALUE
public static final char MAX_CHAR_VALUE
public static final short MAX_SHORT_VALUE
public static final short MIN_SHORT_VALUE
public static final long MIN_LONG_VALUE
public static final long MAX_LONG_VALUE
public static final int MIN_INT_VALUE
public static final int MAX_INT_VALUE
public static final double MAX_DOUBLE_VALUE
public static final double MIN_DOUBLE_VALUE
public static final int MAX_DOUBLE_DIGITS
public static final int SORT_AUTODETECT
detectSortType(Object)
,
Constant Field Valuespublic static final int SORT_OBJECT
public static final int SORT_STRING
public static final int SORT_INT
public static final int SORT_DOUBLE
public static final int SORT_DATE
public static final int SORT_COMPARABLE
public static final int SORT_STRING_NOCASE
public static final long DOUBLE_POSITIVE_INFINITY_BITS
public static final long DOUBLE_NEGATIVE_INFINITY_BITS
public static final long DOUBLE_NAN_BITS
public static final double DOUBLE_POSITIVE_INFINITY_VALUE
public static final double DOUBLE_NEGATIVE_INFINITY_VALUE
public static final double DOUBLE_NAN_VALUE
public static void registerCharacterConverter(AbstractCharacterConverter characterConverter)
characterConverter
- the AbstractCharacterConverter to be registered to this instance
of the running TotalCross VMpublic static boolean setDefaultConverter(java.lang.String name)
Convert.setDefaultConverter("UTF8");to change all bytes_to_char and char_to_bytes operations to use UTF8 instead.
Convert.setDefaultConverter("");sets back the default encoder.
charConverter
,
CharacterConverter
,
UTF8CharacterConverter
public static java.nio.charset.Charset charsetForName(java.lang.String charsetName) throws java.lang.IllegalArgumentException
charsetName
- The name of the requested charset; may be either a canonical name
or an aliasjava.lang.IllegalArgumentException
- If the given charsetName is nullpublic static char toTitleCase(char ch)
ch
- character to convert to titlecasetoLowerCase(char)
,
toUpperCase(char)
public static java.lang.String[] cloneStringArray(java.lang.String[] strs)
public static java.lang.String[] toStringArray(java.lang.Object[] objs)
public static short toShort(java.lang.String s) throws InvalidNumberException
(short)Convert.toInt()
InvalidNumberException
public static int toInt(java.lang.String s) throws InvalidNumberException
InvalidNumberException
- If the string passed is not a valid numberpublic static int toInt(java.lang.String s, int defaultValue)
public static double toDouble(java.lang.String s, double defaultValue)
public static java.lang.String toString(boolean b)
public static java.lang.String toString(char c)
public static int doubleToIntBits(double f)
public static double intBitsToDouble(int i)
public static java.lang.String toString(int i)
public static java.lang.String toString(double val, int decimalCount)
public static double toDouble(java.lang.String s) throws InvalidNumberException
InvalidNumberException
- If the string passed is not a valid numberpublic static java.lang.String toString(java.lang.String doubleValue, int n) throws InvalidNumberException
InvalidNumberException
- If the string passed is not a valid numberpublic static long doubleToLongBits(double value)
Bit 63 represents the sign of the floating-point number. Bits 62-52 represent the exponent. Bits 51-0 represent the significand (sometimes called the mantissa) of the floating-point number.
If the argument is positive infinity, the result is
0x7ff0000000000000L
.
If the argument is negative infinity, the result is
0xfff0000000000000L
.
If the argument is NaN, the result is
0x7ff8000000000000L
.
value
- a double precision floating-point number.public static double longBitsToDouble(long bits)
If the argument is 0x7f80000000000000L
, the result
is positive infinity.
If the argument is 0xff80000000000000L
, the result
is negative infinity.
If the argument is any value in the range
0x7ff0000000000001L
through
0x7fffffffffffffffL
or in the range
0xfff0000000000001L
through
0xffffffffffffffffL
, the result is NaN. All IEEE 754
NaN values are, in effect, lumped together by the Java language
into a single value.
bits
- any long
integer.double
floating-point value with the same
bit pattern.public static int digitOf(char ch, int radix)
public static char forDigit(int digit, int radix)
public static java.lang.String toString(long l)
public static java.lang.String toString(int i, int radix)
public static java.lang.String toString(long i, int radix)
public static java.lang.String toString4D(long i, int radix)
public static long toLong(java.lang.String s) throws InvalidNumberException
InvalidNumberException
- If the string passed is not a valid numberpublic static long toLong(java.lang.String s, int radix) throws InvalidNumberException
InvalidNumberException
- If the string passed is not a valid numberpublic static java.lang.String toString(double d)
public static char toLowerCase(char c)
public static char toUpperCase(char c)
public static java.lang.String numberPad(java.lang.String s, int size)
public static java.lang.String numberPad(int s, int size)
numberPad(String, int)
public static java.lang.String zeroPad(java.lang.String s, int size)
public static java.lang.String zeroPad(int s, int size)
zeroPad(String, int)
public static java.lang.String[] tokenizeString(java.lang.String input, char delim)
public static java.lang.String[] tokenizeString(java.lang.String input, java.lang.String delim)
public static java.lang.String[] tokenizeString(java.lang.String input, char... delims)
input
- a string to be parsed.delims
- the delimiters.public static java.lang.String insertLineBreak(int maxWidth, FontMetrics fm, java.lang.String text)
Convert.insertLineBreak(Settings.screenWidth-10,getFontMetrics(getFont()),"This is a very long text and i dont want to waste my time parsing it to be fit in the MessageBox!");
maxWidth
- the maximum width that is permitted for each line. For a text used in the MessageBox class, use Settings.screenWidth-6
or a lower number.fm
- the FontMetrics of the font you will use to display the texttext
- the text to be parsedpublic static java.lang.String insertLineBreakBalanced(int maxWidth, FontMetrics fm, java.lang.String text)
public static int getBreakPos(FontMetrics fm, java.lang.StringBuffer sb, int start, int width, boolean doWordWrap)
public static void qsort(java.lang.Object[] items, int first, int last)
SORT_AUTODETECT
public static int detectSortType(java.lang.Object item)
public static void qsort(java.lang.Object[] items, int first, int last, int sortType)
Convert.qsort(items,0,items.length-1, SORT_AUTODETECT).You can sort subportions of the array as well.
public static void qsort(java.lang.Object[] items, int first, int last, int sortType, boolean ascending)
Convert.qsort(items,0,items.length-1, Convert.SORT_DATE, true).You can sort subportions of the array as well.
public static java.lang.String unsigned2hex(int b, int places)
public static int hex2unsigned(java.lang.String s)
public static int hex2signed(java.lang.String s)
s
- the string representation of the signed hexadecimalpublic static java.lang.String bytesToHexString(byte[] b)
public static java.lang.String bytesToHexString(byte[] b, int off, int len)
public static byte[] hexStringToBytes(java.lang.String s)
s
- The hex string to convert to bytespublic static byte[] hexStringToBytes(java.lang.String s, boolean ignoreNonHexChars)
s
- The hex string to convert to bytesignoreNonHexChars
- Flag indicating if non hex chars should be ignored or notpublic static long rol(long i, int n, int bits)
bits
. This differs from the
shift left operator (<<) in that the bits are not lost,
they are reinserted in order at the right.i
- The positive number to be rolledn
- The number of bits to be rolled, where 0 <= n <= bitsbits
- The number of bits that will be considered, where 0 < bits <= 64. Bits outside the bit range are masked out. If 0 is given, 64 will be used.
In order to make it faster, the routine does not check for out-of-bounds parameters.public static long ror(long i, int n, int bits)
bits
. This differs from the
shift right operator (>>) in that the bits are not lost,
they are reinserted in order at the left.i
- The positive number to be rolledn
- The number of bits to be rolled, where 0 <= n <= bitsbits
- The number of bits that will be considered, where 0 < bits <= 64 Bits outside the bit range are masked out. If 0 is given, 64 will be used.
In order to make it faster, the routine does not check for out-of-bounds parameters.public static int chars2int(java.lang.String fourChars)
fourChars
- Four characters representing a creator id.public static java.lang.String int2chars(int i)
public static java.lang.String dup(char c, int count)
count
times.java.lang.IllegalArgumentException
- If count is below 0public static int hashCode(java.lang.StringBuffer sb)
public static java.lang.String remove(java.lang.String source, java.lang.String chars)
String s = Convert.remove("abcdef","df"); // returns "abce";
public static java.lang.String replace(java.lang.String source, java.lang.String from, java.lang.String to)
from
String by the to
String in the given source
String.public static int numberOf(java.lang.String s, char c)
public static void insertAt(java.lang.StringBuffer sb, int pos, char c)
public static void append(java.lang.StringBuffer sb, char c, int count)
int dif = colWidth - value.length(); sb.apppend(value); Convert.append(sb, ' ', dif); // pad column with spaces... where sb is the StringBuffer you're using to concatenate the strings, value is the value you're appending, and colWidth is the current column width.
java.lang.ArrayIndexOutOfBoundsException
- If count is below 0.public static byte[] getBytes(java.lang.StringBuffer sb)
byte[] b = sb.toString().getBytes();There's no performance gain in Blackberry nor in Java SE.
public static java.lang.String zeroUnpad(java.lang.String s)
public static int max(int... ai)
public static int sum(int[] ai, int startIndex, int endIndex)
public static int sum(int... ai)
public static int min(int... ai)
public static java.lang.String spacePad(java.lang.String what, int count, boolean before)
public static java.lang.String appendPath(java.lang.String path1, java.lang.String path2)
public static java.lang.String normalizePath(java.lang.String path)
path
- The string to normalize.public static byte[] ints2bytes(int[] from, int count)
{(byte)0x12,(byte)0x34,(byte)0x56,(byte)0x78,(byte)0xAB,(byte)0xCD,(byte)0xEF}
must be stored as
{0x78563412,0x00EFCDAB}
and you must call this method passing 7 for count.
static void bytes2intsDump(byte[] in) { System.out.print("Convert.ints2bytes(new int[]{"); for (int i = 0; i < in.length;) { int b1 = i < in.length ? in[i++] : 0; int b2 = i < in.length ? in[i++] : 0; int b3 = i < in.length ? in[i++] : 0; int b4 = i < in.length ? in[i++] : 0; int out = b1 | (b2 << 8) | (b3 << 16) | (b4 << 24); System.out.print("0x"+Convert.unsigned2hex(out,8)+","); } System.out.println("}, "+in.length+");"); }For example, calling it with:
byte[] in = {1,2,3,4,5,6,7,8,1,2,3,4,5,6,7}; bytes2intsDump(in);Will output this:
Convert.ints2bytes(new int[]{0x04030201,0x08070605,0x04030201,0x00070605}, 15);Note that you must not include the bytes2intsDump into the program that is going to the device. It is a desktop-only utility method.
from
- The source int arraycount
- The length of the target byte array. It may differ from from.length*4
because the last value of the array may be padded.public static void fill(char[] a, int from, int to, char value)
public static void fill(boolean[] a, int from, int to, boolean value)
public static void fill(int[] a, int from, int to, int value)
public static void fill(double[] a, int from, int to, double value)
public static void fill(short[] a, int from, int to, int value)
public static void fill(byte[] a, int from, int to, int value)
public static void fill(long[] a, int from, int to, long value)
public static void fill(java.lang.Object[] a, int from, int to, java.lang.Object value)
public static java.lang.String toCurrencyString(double d, int decimalPlaces)
d
- the double to be converted to String.decimalPlaces
- the number of decimal places. Must be >= -1.toCurrencyString(String,int)
public static java.lang.String toCurrencyString(java.lang.String s, int decimalPlaces)
s
- the double String to be converted to String. It must already have the given number of decimal places.decimalPlaces
- the number of decimal places. Must be >= -1.toCurrencyString(double,int)
public static java.lang.String[] tokenizeArguments(java.lang.String arg)
public static boolean isUpperCase(char c)
public static boolean isLowerCase(char c)
public static double getDistancePoint2Rect(int x, int y, int x1, int y1, int x2, int y2)
public static java.lang.StringBuffer appendTimeStamp(java.lang.StringBuffer sb, Time t, boolean appendDate, boolean appendTime)
public static java.lang.String getFilePath(java.lang.String fullPath)
public static java.lang.String getFileName(java.lang.String fullPath)
public static java.lang.String getFileNameOnly(java.lang.String fullPath)
public static java.lang.String removeAccentuation(java.lang.String s)
public static boolean equals(byte[] b1, byte[] b2)