Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Tools Class Reference

Static Public Member Functions

static String c2hex (Color c)
 
static String f2hex (float f)
 
static double[] getMinMax (double[] a)
 
static double[] getMinMax (float[] a)
 
static double[] toDouble (float[] a)
 
static float[] toFloat (double[] a)
 
static String fixNewLines (String s)
 
static double parseDouble (String s, double defaultValue)
 
static double parseDouble (String s)
 
static int getDecimalPlaces (double n1, double n2)
 

Static Public Attributes

static final char[] hexDigits = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}
 

Detailed Description

This class contains static utility methods.

Definition at line 5 of file Tools.java.

Member Function Documentation

static String c2hex ( Color  c)
inlinestatic

Converts a Color to an 7 byte hex string starting with '#'.

Definition at line 10 of file Tools.java.

static String f2hex ( float  f)
inlinestatic

Converts a float to an 9 byte hex string starting with '#'.

Definition at line 22 of file Tools.java.

static String fixNewLines ( String  s)
inlinestatic

Converts carriage returns to line feeds.

Definition at line 86 of file Tools.java.

static int getDecimalPlaces ( double  n1,
double  n2 
)
inlinestatic

Returns the number of decimal places need to display two numbers.

Definition at line 124 of file Tools.java.

static double parseDouble ( String  s,
double  defaultValue 
)
inlinestatic

Returns a double containg the value represented by the specified String.

Parameters
sthe string to be parsed.
defaultValuethe value returned if s does not contain a parsable double
Returns
The double value represented by the string argument or defaultValue if the string does not contain a parsable double

Definition at line 103 of file Tools.java.

static double parseDouble ( String  s)
inlinestatic

Returns a double containg the value represented by the specified String.

Parameters
sthe string to be parsed.
Returns
The double value represented by the string argument or Double.NaN if the string does not contain a parsable double

Definition at line 119 of file Tools.java.

static double [] toDouble ( float[]  a)
inlinestatic

Converts the float array 'a' to a double array.

Definition at line 68 of file Tools.java.

static float [] toFloat ( double[]  a)
inlinestatic

Converts the double array 'a' to a float array.

Definition at line 77 of file Tools.java.

Field Documentation

final char [] hexDigits = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}
static

This array contains the 16 hex digits '0'-'F'.

Definition at line 7 of file Tools.java.


The documentation for this class was generated from the following file: