chrriis.uihierarchy.util
Class UnitParser

java.lang.Object
  extended bychrriis.uihierarchy.util.UnitParser

public class UnitParser
extends Object

A utility class to parse and convert units from their string representations.

Version:
1.0 2005.02.02
Author:
Christopher Deckers (chrriis@brainlex.com)

Method Summary
static double doublePixelValue(UIHConfig uihConfig, String unitValueRepresentation)
          Convert a string representation of a value with or without a unit specification, into its pixel double value.
static int intPixelValue(UIHConfig uihConfig, String unitValueRepresentation)
          Convert a string representation of a value with or without a unit specification, into its pixel integer value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

intPixelValue

public static int intPixelValue(UIHConfig uihConfig,
                                String unitValueRepresentation)
Convert a string representation of a value with or without a unit specification, into its pixel integer value.

Parameters:
unitValueRepresentation - The value to convert, eventually defined in a unit other than pixel.
Returns:
The result of the conversion to the pixel value.

doublePixelValue

public static double doublePixelValue(UIHConfig uihConfig,
                                      String unitValueRepresentation)
Convert a string representation of a value with or without a unit specification, into its pixel double value.

Parameters:
unitValueRepresentation - The value to convert, eventually defined in a unit other than pixel.
Returns:
The result of the conversion to the pixel value.