|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gshute.ioutil.Formatting
The Formatting class provides utility methods for formatting text for String and numerical data.
Method Summary | |
static java.lang.String |
binary(long n,
int w)
Formatting.binary(n, w) returns the unsigned binary representation of n, right justified in a string field of width at least w. |
static java.lang.String |
binary(long n,
int w,
char fc)
Formatting.binary(n, w, fc) returns the unsigned binary representation of n, right justified in a string field of width at least w. |
static java.lang.String |
decimal(long n,
int w)
Formatting.decimal(n, w) returns the decimal representation of n, right justified in a string field of width at least w. |
static java.lang.String |
decimal(long n,
int w,
char fc)
Formatting.decimal(n, w, fc) returns the decimal representation of n, right justified in a string field of width at least w. |
static java.lang.String |
filledLeft(java.lang.String str,
int w)
Formatting.filledLeft(str, w) returns a copy of the string str, right justified in a string field of width at least w. |
static java.lang.String |
filledLeft(java.lang.String str,
int w,
char fc)
Formatting.filledLeft(str, w, fc) returns a copy of the string str, right justified in a string field of width at least w. |
static java.lang.String |
filledRight(java.lang.String str,
int w)
Formatting.filledRight(str, w) returns a copy of the string str, right justified in a string field of width at least w. |
static java.lang.String |
filledRight(java.lang.String str,
int w,
char fc)
Formatting.filledRight(str, w, fc) returns a copy of the string str, left justified in a string field of width at least w. |
static java.lang.String |
fillString(int w)
Formatting.fillString(w) returns a string of length w whose characters are all spaces. |
static java.lang.String |
fillString(int w,
char fc)
Formatting.fillString(w, fc) returns a string of length w whose characters are all copies of fc. |
static java.lang.String |
fixedPoint(double x,
int w,
int p)
Formatting.fixedPoint(x, w, p) returns the fixed point representation of x, right justified in a string field of width at least w, with p digits after the decimal point. |
static java.lang.String |
floatingPoint(double x,
int w,
int i,
int p)
Formatting.floatingPoint(x, w, i, p) returns the floating point representation of x, right justified in a string field of width at least w, with i digits before the decimal point and p digits after the decimal point. |
static java.lang.String |
hexadecimal(long n,
int w)
Formatting.hexadecimal(n, w) returns the unsigned hexadecimal representation of n, right justified in a string field of width at least w. |
static java.lang.String |
hexadecimal(long n,
int w,
char fc)
Formatting.hexadecimal(n, w, fc) returns the unsigned hexadecimal representation of n, right justified in a string field of width at least w. |
static java.lang.String |
octal(long n,
int w)
Formatting.octal(n, w) returns the unsigned octal representation of n, right justified in a string field of width at least w. |
static java.lang.String |
octal(long n,
int w,
char fc)
Formatting.octal(n, w, fc) returns the unsigned octal representation of n, right justified in a string field of width at least w. |
static java.lang.String |
trimmedLeft(java.lang.String str,
int w)
Formatting.trimmedLeft(str, w) returns a copy of the string str, trimmed on the left if necessary to fit in a string field of width w. |
static java.lang.String |
trimmedRight(java.lang.String str,
int w)
Formatting.trimmedRight(str, w) returns a copy of the string str, trimmed on the right if necessary to fit in a string field of width w. |
static java.lang.String |
whiteEquivalent(java.lang.String str)
Formatting.whiteEquivalent(str) returns a string that displays in the same space as str, but contains space characters replacing the non-white characters of str. |
static java.lang.String |
whiteEquivalent(java.lang.String str,
char ch)
Formatting.whiteEquivalent(str, ch) returns a string that displays in the same space as str, but contains copies of ch replacing the non-white characters of str. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Method Detail |
public static java.lang.String fillString(int w, char fc)
public static java.lang.String fillString(int w)
public static java.lang.String filledLeft(java.lang.String str, int w)
public static java.lang.String filledLeft(java.lang.String str, int w, char fc)
public static java.lang.String filledRight(java.lang.String str, int w)
public static java.lang.String filledRight(java.lang.String str, int w, char fc)
public static java.lang.String trimmedLeft(java.lang.String str, int w)
public static java.lang.String trimmedRight(java.lang.String str, int w)
public static java.lang.String whiteEquivalent(java.lang.String str)
public static java.lang.String whiteEquivalent(java.lang.String str, char ch)
public static java.lang.String decimal(long n, int w, char fc)
public static java.lang.String decimal(long n, int w)
public static java.lang.String hexadecimal(long n, int w, char fc)
public static java.lang.String hexadecimal(long n, int w)
public static java.lang.String octal(long n, int w, char fc)
public static java.lang.String octal(long n, int w)
public static java.lang.String binary(long n, int w, char fc)
public static java.lang.String binary(long n, int w)
public static java.lang.String fixedPoint(double x, int w, int p)
public static java.lang.String floatingPoint(double x, int w, int i, int p)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |