All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cricinfo.gadgets.Formats

java.lang.Object
   |
   +----cricinfo.gadgets.Formats

public class Formats
extends Object
A collection of formatting tools suitable for use in 1.02 classes. All methods are static so this class need never be instantiated.


Constructor Index

 o Formats()

Method Index

 o jl(String, int)
Format a String into a left format String of cols length.
 o jr(int, double, int)
Format a double into a right justified String with decimal_places significant figures (truncated not rounded) left column padded with spaces, decimal figures padded with 0's.
 o jr(int, int)
Format an integer into a right justified String of cols length, leftside if padded with spaces.

Constructors

 o Formats
 public Formats()

Methods

 o jl
 public static final String jl(String str,
                               int cols)
Format a String into a left format String of cols length. This pads out to the right with spaces.

Parameters:
str - the String to be formatted
cols - the length of the String to return
 o jr
 public static final String jr(int number,
                               int cols)
Format an integer into a right justified String of cols length, leftside if padded with spaces.

Parameters:
number - The integer to be formatted
cols - the length of the String to be returned
 o jr
 public static final String jr(int cols,
                               double number,
                               int decimal_places)
Format a double into a right justified String with decimal_places significant figures (truncated not rounded) left column padded with spaces, decimal figures padded with 0's.

Parameters:
cols - the number of columns before the decimal place
number - the number to format
decimal_places - how many significant figures

All Packages  Class Hierarchy  This Package  Previous  Next  Index