Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.utilities.output
Class Format

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.utilities.output.Format

public class Format
extends Object

Provides several methods for formatting objects for print purposes.

Author:
Elke Achtert

Field Summary
static NumberFormat NF2
          Number Formatter for output purposes.
static NumberFormat NF4
           
static NumberFormat NF8
           
 
Constructor Summary
Format()
           
 
Method Summary
static String blanks(int n)
          Returns a string with the specified number of blanks.
static String format(double[] d)
          Formats the double array d with ', ' as separator.
static String format(double[] d, int digits)
          Formats the double array d with ', ' as separator and with the specified fraction digits.
static String format(double[] d, String sep)
          Formats the double array d with the specified separator.
static String format(double[] d, String sep, int digits)
          Formats the double array d with the specified separator and the specified fraction digits.
static String format(double d, int digits)
          Formats the double d with the specified fraction digits.
static String format(HyperBoundingBox box, int digits)
          Formats the hyper bounding box with ', ' as separator and with the specified fraction digits.
static String format(int input, int maximum)
          Returns an integer-string for the given input, that has as many leading zeros as to match the length of the specified maximum.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NF2

public static final NumberFormat NF2
Number Formatter for output purposes.


NF4

public static final NumberFormat NF4

NF8

public static final NumberFormat NF8
Constructor Detail

Format

public Format()
Method Detail

format

public static String format(double d,
                            int digits)
Formats the double d with the specified fraction digits.

Parameters:
d - the double array to be formatted
digits - the number of fraction digits
Returns:
a String representing the double d

format

public static String format(double[] d)
Formats the double array d with ', ' as separator.

Parameters:
d - the double array to be formatted
Returns:
a String representing the double array d

format

public static String format(double[] d,
                            String sep,
                            int digits)
Formats the double array d with the specified separator and the specified fraction digits.

Parameters:
d - the double array to be formatted
sep - the seperator between the single values of the double array, e.g. ','
digits - the number of fraction digits
Returns:
a String representing the double array d

format

public static String format(double[] d,
                            String sep)
Formats the double array d with the specified separator.

Parameters:
d - the double array to be formatted
sep - the seperator between the single values of the double array, e.g. ','
Returns:
a String representing the double array d

format

public static String format(double[] d,
                            int digits)
Formats the double array d with ', ' as separator and with the specified fraction digits.

Parameters:
d - the double array to be formatted
digits - the number of fraction digits
Returns:
a String representing the double array d

format

public static String format(int input,
                            int maximum)
Returns an integer-string for the given input, that has as many leading zeros as to match the length of the specified maximum.

Parameters:
input - an integer to be formatted
maximum - the maximum to adapt the format to
Returns:
an integer-string for the given input, that has as many leading zeros as to match the length of the specified maximum

format

public static String format(HyperBoundingBox box,
                            int digits)
Formats the hyper bounding box with ', ' as separator and with the specified fraction digits.

Parameters:
box - the box to be formatted
Returns:
a String representing the hyper bounding box

blanks

public static String blanks(int n)
Returns a string with the specified number of blanks.

Parameters:
n - the nuber of blanks
Returns:
a string with the specified number of blanks

Release 0.1 (2008-07-10_1838)