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