|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectview.TextFormat
public class TextFormat
Class to provide formating routines for integers and doubles.
Calling the format(int) method with a value of 3.1415926536 yields
the following output:
format(val) >3.14159< format(val, 3.e-8) >3.14159265< format(val,7) >3.1415927< format(val,13, 5) > 3.14159< format(val,13, 5, false) > 3.14159< format(val,18,6,true,true,true,false) >3.1415930000000000< format(val,18,6, false,true, false, false) >00000000003.141593< format(val,18,6, false,true, false, true) >+0000000003.141593< format(val,18,0,true,false,false,false,false) > 3<
| Field Summary | |
|---|---|
private static String |
COMMA
|
| Constructor Summary | |
|---|---|
TextFormat()
|
|
| Method Summary | |
|---|---|
static String |
dup(char what,
int howoften)
Returns a String containing howoften representations of char what. |
static String |
format(double num)
|
static String |
format(double num,
boolean suppress)
|
static String |
format(double num,
double prec)
|
static String |
format(double num,
double prec,
boolean suppress)
|
static String |
format(double num,
int prec)
|
static String |
format(double num,
int prec,
boolean suppress)
|
static String |
format(double num,
int len,
int prec)
|
static String |
format(double num,
int len,
int prec,
boolean suppress)
|
static String |
format(double num,
int len,
int prec,
boolean suppress,
boolean zero)
|
static String |
format(double num,
int len,
int prec,
boolean suppress,
boolean zero,
boolean rpad,
boolean plus)
|
static String |
format(double num,
int len,
int prec,
boolean suppress,
boolean zero,
boolean rpad,
boolean plus,
boolean coma)
|
static String |
format(int num)
|
static String |
format(int num,
int len)
|
static String |
format(int num,
int len,
boolean zero)
|
static String |
format(int num,
int len,
boolean zero,
boolean rpad,
boolean plus)
|
static String |
format(long num)
|
static String |
format(long num,
int len)
|
static String |
format(long num,
int len,
boolean zero)
|
static String |
format(long num,
int len,
boolean zero,
boolean rpad,
boolean plus)
|
protected static String |
getPad(boolean zero)
|
static double |
getRound(double num)
|
static double |
getRound(double num,
int prec)
|
protected static String |
getSign(double num,
boolean plus)
|
static String |
leftPadTo(String what,
int len)
Returns a string with the minimal given length, left-padded with spaces. |
static String |
leftString(String arg,
int left)
Returns a String of length left, starting from arg index 0. |
static void |
main(String[] arg)
|
static String |
rightPadTo(String what,
int len)
Returns a string with the minimal given length, right-padded with spaces. |
static String |
rightString(String arg,
int right)
Returns the last right characters of arg as a String. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final String COMMA
| Constructor Detail |
|---|
public TextFormat()
| Method Detail |
|---|
public static String dup(char what,
int howoften)
public static String leftString(String arg,
int left)
public static String rightString(String arg,
int right)
public static final String rightPadTo(String what,
int len)
public static final String leftPadTo(String what,
int len)
public static String format(int num)
public static String format(long num)
public static String format(int num,
int len)
public static String format(long num,
int len)
public static String format(int num,
int len,
boolean zero)
public static String format(long num,
int len,
boolean zero)
public static String format(int num,
int len,
boolean zero,
boolean rpad,
boolean plus)
protected static String getSign(double num,
boolean plus)
protected static String getPad(boolean zero)
public static String format(long num,
int len,
boolean zero,
boolean rpad,
boolean plus)
public static double getRound(double num)
public static double getRound(double num,
int prec)
public static String format(double num)
public static String format(double num,
boolean suppress)
public static String format(double num,
double prec)
public static String format(double num,
double prec,
boolean suppress)
public static String format(double num,
int prec)
public static String format(double num,
int prec,
boolean suppress)
public static String format(double num,
int len,
int prec)
public static String format(double num,
int len,
int prec,
boolean suppress)
public static String format(double num,
int len,
int prec,
boolean suppress,
boolean zero)
public static String format(double num,
int len,
int prec,
boolean suppress,
boolean zero,
boolean rpad,
boolean plus)
public static String format(double num,
int len,
int prec,
boolean suppress,
boolean zero,
boolean rpad,
boolean plus,
boolean coma)
public static void main(String[] arg)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||