com.pixelmed.utils
Class FloatFormatter

java.lang.Object
  extended by com.pixelmed.utils.FloatFormatter

public class FloatFormatter
extends Object

Various static methods helpful for formatting floating point values.


Method Summary
static double[] fromString(String s, char delimChar)
          Extract an arbitrary number of delimited numeric values from a string into an array of doubles.
static double[] fromString(String s, int wanted, char delimChar)
          Extract a specified number of delimited numeric values from a string into an array of doubles.
static String toString(double value)
          Given a double value, return a string representation without too many decimal places.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toString

public static String toString(double value)

Given a double value, return a string representation without too many decimal places.

Parameters:
value - the value to format into a string
Returns:
the formatted string

fromString

public static final double[] fromString(String s,
                                        int wanted,
                                        char delimChar)

Extract a specified number of delimited numeric values from a string into an array of doubles.

Parameters:
s - the string containing delimited double values
wanted - the number of double values wanted
delimChar - the delimiter character
Returns:
an array of doubles of the size wanted containing the values, else null

fromString

public static final double[] fromString(String s,
                                        char delimChar)

Extract an arbitrary number of delimited numeric values from a string into an array of doubles.

Parameters:
s - the string containing delimited double values
delimChar - the delimiter character
Returns:
an array of doubles of the size wanted containing the values, else null