|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object PIRL.Strings.String_Utilities
public class String_Utilities
The String_Utilities are a collection of static functions that operate on String objects to provide various commonly used operations.
Field Summary | |
---|---|
static int |
DEFAULT_DECIMAL_DIGITS
The default number of decimal digits used by the Amount_Magnitude(long, int) function. |
static String |
ID
Class identification with revision number and date. |
static int |
MAX_DECIMAL_DIGITS
The default number of decimal digits used by the Amount_Magnitude(long, int) function. |
Method Summary | |
---|---|
static String |
Amount_Magnitude(long amount)
Provide a binary magnitude String representation of an amount. |
static String |
Amount_Magnitude(long amount,
int decimal_digits)
Provide a binary magnitude String representation of an amount. |
static String |
Following(String string,
char delimiter)
Gets that portion of a String following a delimiter. |
static String |
Preceeding(String string,
char delimiter)
Gets that portion of a String preceeding a delimiter. |
static String |
Trim(String string,
char delimiter)
Trims all delimiter characters from both ends of a string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ID
public static final int DEFAULT_DECIMAL_DIGITS
Amount_Magnitude(long, int)
function.
public static final int MAX_DECIMAL_DIGITS
Amount_Magnitude(long, int)
function.
Method Detail |
---|
public static String Trim(String string, char delimiter)
string
- The String to trim.delimiter
- The character to be trimmed off the ends.
public static String Preceeding(String string, char delimiter)
string
- The String from which to get the leading portion.delimiter
- The delimiter character.
public static String Following(String string, char delimiter)
string
- The String from which to get the trailing portion.delimiter
- The delimiter character.
public static String Amount_Magnitude(long amount, int decimal_digits)
An amount that is less than 1024 is returned as its String representation. Otherwise it is divided by 1024 until its value is less than 1024, up to a maximum of five times. The number of divisions determines the binary magnitude of the amount, the first character of which is then appended to the String representation of the reduced value:
Negative values are treated as positive values with the negative sign applied to the final result.
amount
- The amount to be represented.decimal_digits
- The number of decimal digits in the reduced
amount representation. If this is negative the DEFAULT_DECIMAL_DIGITS
will be used. The number of digits will
be limited to a maximum of MAX_DECIMAL_DIGITS
.
public static String Amount_Magnitude(long amount)
The DEFAULT_DECIMAL_DIGITS
number of decimal digits in the
reduced amount representation will be used.
amount
- The amount to be represented.
Amount_Magnitude(long, int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |