|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.util.Format
public class Format
static formatting utilities. Replace with standard java library when possible.
| Constructor Summary | |
|---|---|
Format()
|
|
| Method Summary | |
|---|---|
static String |
d(double d,
int min_sigfig)
Double value formatting with minimum number of significant figures in a minimum width. |
static String |
d(double d,
int min_sigfig,
int width)
Double value formatting with minimum number of significant figures in a specified width. |
static String |
dfrac(double d,
int fixed_decimals)
Double value formatting with fixed number of digits to the right of the decimal point. |
static String |
formatByteSize(double size)
Nicely formatted representation of bytes, eg turn 5.636E7 into |
static String |
formatDouble(double d,
int min_sigFigs,
int fixed_decimals)
Format a double value |
static String |
i(int v,
int width)
Format an integer value. |
static String |
l(long v,
int width)
Format a long value. |
static void |
main(String[] argv)
Main method for testing |
static String |
pad(String s,
int width,
boolean rightJustify)
Create a new string by padding the existing one with blanks to specified width. |
static String |
s(String s,
int width)
Create a new string by padding the existing one with blanks to specified width. |
static void |
tab(StringBuffer sbuff,
int tabStop,
boolean alwaysOne)
Blank fill sbuff with blanks, until position tabStop. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Format()
| Method Detail |
|---|
public static void tab(StringBuffer sbuff,
int tabStop,
boolean alwaysOne)
sbuff - StringBuffer to manipulatetabStop - pad out to herealwaysOne - true if you want to guarentee at least one space.
public static String s(String s,
int width)
s - string to padwidth - length of return string
public static String pad(String s,
int width,
boolean rightJustify)
s - string to padwidth - length of return stringrightJustify - if true, right justify, else left justify
public static String i(int v,
int width)
v - : valuewidth - pad to this width
public static String l(long v,
int width)
v - : valuewidth - pad to this width
public static String d(double d,
int min_sigfig)
d - the number to format.min_sigfig - minimum number of significant figures
public static String d(double d,
int min_sigfig,
int width)
d - the number to format.min_sigfig - minimum number of significant figureswidth - width of the result
public static String dfrac(double d,
int fixed_decimals)
d - the number to format.fixed_decimals - number of digits to the right of the decimal point
public static String formatDouble(double d,
int min_sigFigs,
int fixed_decimals)
d - value to formatmin_sigFigs - minimum significant figuresfixed_decimals - number of fixed decimals
public static String formatByteSize(double size)
size - the size in bytes
public static void main(String[] argv)
argv - ignored
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||